class LinearRegressionLearner(classification.Fitter):
def fit(self, X, Y, W):
clf = LinearRegression()
return LinearRegressionPredictor(clf.fit(X, Y.reshape(-1)))
class LinearRegressionPredictor(classification.Model):
After Change
raise ValueError("Linear regression does not support "
"unknown values")
theta = np.zeros(X.shape[1])
theta, cost, ret = fmin_l_bfgs_b(self.cost_grad, theta,
args=(X, Y.ravel()), **self.fmin_args)