#NEWLINE# @ overrides #NEWLINE# def fit( self , paths ) : #NEWLINE# #INDENT# featmat = np . concatenate ( [ self . _features ( path ) for path in paths ] ) #NEWLINE# returns = np . concatenate ( [ path [ 'returns' ] for path in paths ] ) #NEWLINE# self . _coeffs = np . linalg . lstsq ( ( featmat . T . dot ( featmat ) + ( self . _reg_coeff * np . identity ( featmat . shape [ 1 ] ) ) ) , featmat . T . dot ( returns ) ) [ 0 ]