def fit(self, X, y):
    if (self.hat is None):
        G = (X.T.dot(X) + (self.lmd * np.eye(X.shape[1])))
        self.hat = np.linalg.solve(G, X.T)
    if (self.hatn is None):
        y0 = np.array((list(y[:(- 1)]) + [0]))
        self.hatn = self.hat.dot(y0)
    self.beta = (self.hatn + (y[(- 1)] * self.hat[:, (- 1)]))
def fit(self, X, y):
    if (self.hat is None):
        G = (X.T.dot(X) + (self.lmd * np.eye(X.shape[1])))
        self.hat = np.linalg.solve(G, X.T)
    if (self.hatn is None):
        y0 = np.array((list(y[:(- 1)]) + [0]))
        self.hatn = self.hat.dot(y0)
    self.beta = (self.hatn + (y[(- 1)] * self.hat[:, (- 1)]))