I currently have the following code, which does a polynomial regression on a dataset with 4 variables:
def polyreg():
dataset = genfromtxt(open('train.csv','r'), delimiter=',', dtype='f8')[1:]
target = [x[0] for x in dataset]
train = [x[1:] for x in dataset]
test = genfromtxt(open('test.csv','r'), delimiter=',', dtype='f8')[1:]
poly = PolynomialFeatures(degree=2)
train_poly = poly.fit_transform(train)
test_poly = poly.fit_transform(test)
clf = linear_model.LinearRegression()
clf.fit(train_poly, target)
savetxt('polyreg_test1.csv', clf.predict(test_poly), delimiter=',', fmt='%f')
I wanted to know if there was a way to output a summary of the regression like in Excel ? I explored the attributes/methods of linear_model.LinearRegression() but couldn't find anything.
