def fit(self, X, s): _x = np.ones((X.shape[0], X.shape[1] + 1)) _x[:, : - 1] = X self.w, _, _, _ = np.linalg.lstsq(_x, logit(s))