FukuML/LinearRegression.py
def train(self):

        '''
        Train Linear Regression Algorithm
        From f(x) = WX
        Find best h(x) = WX similar to f(x)
        Output W
        '''

        if (self.status != 'init'):
            print("Please load train data and init W first.")
            return self.W

        self.status = 'train'

        self.xpsedo = self.calculate_psedo_X(self.train_X)
        self.W = np.dot(self.xpsedo, self.train_Y)

        return self.W
def train(self):

        '''
        Train Linear Regression Algorithm
        From f(x) = WX
        Find best h(x) = WX similar to f(x)
        Output W
        '''

        if (self.status != 'init'):
            print("Please load train data and init W first.")
            return self.W

        self.status = 'train'

        self.xpsedo = self.calculate_psedo_X(self.train_X)
        self.W = np.dot(self.xpsedo, self.train_Y)

        return self.W
def train ( self ) : if ( self . status != 'init' ) : print ( "Please load train data and init W first." ) return self . W self . status = 'train' self . xpsedo = self . calculate_psedo_X ( self . train_X ) self . W = np . dot ( self . xpsedo , self . train_Y ) return self . W
Train Linear Regression Algorithm
        From f(x) = WX
        Find best h(x) = WX similar to f(x)
        Output W
Train Linear Regression Algorithm From f ( x ) = WX Find best h ( x ) = WX similar to f ( x ) Output W