#NEWLINE# def fit( self , X , y ) : #NEWLINE# #INDENT# 'Estimate the coefficients of the linear model.\n        Save the coefficients in the attribute filters_ and\n        computes the attribute patterns_ using [1].\n\n        Parameters\n        ----------\n        X : array, shape (n_epochs, n_features)\n            The data to estimate the coeffiscient.\n        y : array, shape (n_epochs,)\n            The class for each epoch.\n\n        Returns\n        -------\n        self : instance of LinearModel\n            Returns the modified instance.\n\n        References\n        ----------\n        ' #NEWLINE# self . model . fit ( X , self ) #NEWLINE# assert hasattr ( self . model , 'coef_' ) , 'model needs a coef_ attribute to compute the patterns' #NEWLINE# self . patterns_ = np . dot ( X . T , np . dot ( X , self . model . coef_ . T ) ) #NEWLINE# self . filters_ = self . model . coef_ #NEWLINE# return self