Question: ( 2 0 points ) Now that we've gotten to know our data a little bit, we will use SciKit Learn and a validation /

(20 points) Now that we've gotten to know our data a little bit, we will use SciKit Learn
and a validation/train split to see how well our model - using the same DV and IVs as Q2-
can predict a player's rank.
(a)(2 points). Based on the statsmodels output from Q2, 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 out-of-sample data? Briefly explain why or why not.
(b)(2 points). Create an x 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)(2 points). Create a validation/train split where 25% of the data is held out for
validation. Use a random seed of 123(i.e., set the random state to this value). To show
your code has worked, display the first 5 rows of the x training data.
(d)(2 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)(2 points) Compare the coefficients estimated by both regression models. How does the
coefficient for "attacking" change (if at all) when it is estimated in Q2(using statsmodels
and the full dataset) vs when it is estimated in Q3(using SKLearn and just training data)?
(f)(2 points) Use your trained SKLearn regression model to predict rank values for the
hold-out set of x validation data. Display at least the first three predicted values (in a
format of your choice).
(g)(2 points) Display a scatterplot in which the horizontal axis shows the actual value of
the Y validation data and the vertical axis displays the predicted Y values for the x
validation data.
(h)(2 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.
( 2 0 points ) Now that we've gotten to know our

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!