Mar-08-2020, 06:19 PM
I´ve built a polynomial regression model based on the train dataset. But I have no clue if the result is good or how to tweak him.
train_regression
train_regression
array = train_dataset.values y = array[:,1].reshape(-1, 1) X = array[:,0].reshape(-1, 1) #print (X,y) poly = PolynomialFeatures(degree = 5) X_poly = poly.fit_transform(X) poly.fit(X_poly, y) lin2 = LinearRegression() lin2.fit(X_poly, y) plt.scatter(X, y, color = 'blue') plt.plot(X, lin2.predict(poly.fit_transform(X)), color = 'red') plt.show()