Created
July 12, 2018 01:04
-
-
Save securetorobert/7c22c56b241ccc7463acc48844bfa403 to your computer and use it in GitHub Desktop.
Polynomial features and ridge regression model applied to Boston housing data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment