Question: ( 2 0 points ) Now that we've gotten to know our data a little bit, we will use SciKit Learn and a validation /
points Now that we've gotten to know our data a little bit, we will use SciKit Learn
and a validationtrain split to see how well our model using the same DV and IVs as Q
can predict a player's rank.
a points Based on the statsmodels output from Q do you expect that these four
features passing attacking, defending, and skill will do a pretty good or pretty bad
job at predicting rank for outofsample data? Briefly explain why or why not.
b points Create an dataframe with just four features: passing, attacking, defending,
and skill. Create a Y dataframe or series with just the "rank" variable. Display the
first five rows of each.
c points Create a validationtrain split where of the data is held out for
validation. Use a random seed of ie set the random state to this value To show
your code has worked, display the first rows of the training data.
d points Use SKLearn to train a linear regression using only the training data. Display
the intercept and coefficients for your trained model coefficients do not need to be
labeled
e points Compare the coefficients estimated by both regression models. How does the
coefficient for "attacking" change if at all when it is estimated in Qusing statsmodels
and the full dataset vs when it is estimated in Qusing SKLearn and just training data
f points Use your trained SKLearn regression model to predict rank values for the
holdout set of validation data. Display at least the first three predicted values in a
format of your choice
g points Display a scatterplot in which the horizontal axis shows the actual value of
the validation data and the vertical axis displays the predicted values for the
validation data.
h points Calculate and display the Root Mean Squared Error RMSE for this model.
Provide a brief interpretation of what this means in terms of the "average error" of the
model.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
