Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using your ols _ model, sgd _ model, and ridge _ model make predictions using your X _ test data and save these predictions as
Using your olsmodel, sgdmodel, and ridgemodel make predictions using your Xtest data and save these predictions as olspred, sgdpred, and ridgepred respectively.
Find the RMSE for each model using ScikitLearn's meansquarederror function passing it your ytest and predictions from step above. Round these RMSE scores to decimal places. Save these scores as rmseols, rmsesgd and rmseridge respectively. Hint: Remember that we are asking for RMSE and not MSE. Check ScikitLearn's documentation for how to calculate the RMSE value.
Find the Rsquared values for each model using ScikitLearn's rscore function passing it your ytest and predictions from step above. Round these Rsquared scores to decimal places. Save these scores as rols, rsgd and rridge respectively.
Print the MSE and Rsquared scores for each model.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started