Computer scienceData scienceInstrumentsScikit-learnTraining ML models with scikit-learnRegression in scikit-learn

Polynomial Regression with scikit-learn

Polynomial regression step-by-step

Report a typo

Rearrange the code lines below in the correct order to fit the polynomial regression on array X, make predictions, and calculate the error.

Put the items in the correct order
y_pred = model.predict(X_test)
rmse = mean_squared_error(y_test, y_pred, squared = False)
model = LinearRegression()
transformed_features = poly.fit_transform(np.array(X).reshape(-1, 1))
X_train, X_test, y_train, y_test = train_test_split(transformed_features, y, train_size=0.75, random_state=42)
model.fit(X_train, y_train)
poly = PolynomialFeatures(degree= 4 , include_bias= True)
___

Create a free account to access the full topic