Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- steps = [
- ('scalar', StandardScaler()),
- ('poly', PolynomialFeatures(degree=2)),
- ('model', Ridge(alpha=10, fit_intercept=True))
- ]
- ridge_pipe = Pipeline(steps)
- ridge_pipe.fit(X_train, y_train)
- print('Training Score: {}'.format(ridge_pipe.score(X_train, y_train)))
- print('Test Score: {}'.format(ridge_pipe.score(X_test, y_test)))
Add Comment
Please, Sign In to add comment