Created
March 12, 2020 07:39
-
-
Save aniruddha27/5c88215717d4eefdc75d9f4a49c0ba3a to your computer and use it in GitHub Desktop.
This file contains 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
#import ridge model | |
from sklearn.linear_model import Ridge | |
#fit on training data with regularization of 0.3 | |
ridge = Ridge(alpha = 0.3) | |
ridge.fit(X_train,y_train) | |
#accuracy | |
print('Train',ridge.score(X_train,y_train)) | |
print('Test',ridge.score(X_test,y_test)) | |
#RMSE score | |
pred = ridge.predict(X_test) | |
rmse = np.sqrt(mean_squared_error(y_test,pred)) | |
print('rmse',rmse) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment