2.1. Exercises
Linear Model Coefficient Questions
Use the following equation to answer the questions below:
True or False: Coefficients
Interpreting Ridge
Instructions:
Running a coding exercise for the first time could take a bit of time for everything to load. Be patient, it could take a few minutes.
When you see ____ in a coding exercise, replace it with what you assume to be the correct code. Run it and see if you obtain the desired output. Submit your code to validate if you were correct.
Make sure you remove the hash (#) symbol in the coding portions of this question. We have commented them so that the line won’t execute and you can test your code after each step.
Using the same Ridge model as we obtained last time, let’s calculate what our model would predict for a player who is 2.05m tall and weighs 93.2 kg.
Tasks:
- Build and fit a
Ridgemodel with default hyperparameters and name itridge_bb. - What are the coefficients for this model? Save these in an object named
bb_coeffs. - What is the intercept for this model? Save this in an object named
bb_intercept. - Using the coefficients and intercept discovered above, calculate the model’s prediction and save the result in
player_predict. - Check your answer using
predict.