6.1. Exercises
Dummy Regressors
Dummy Regressor Scores
Below are the values for y that were used to train DummyRegressor(strategy='mean'):
Grade
0 75
1 80
2 90
3 95
4 85
dtype: int64
Building a Dummy Regressor
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.
Letβs build a baseline model by using DummyRegressor().
Tasks:
- Build a baseline model using the
DummyRegressor()andmeanfor thestrategyargument. Save this in an object namedmodel. - Fit your model and then predict on the target column.
- What is the accuracy of the model to 2 decimal places? Save this in the object
accuracy.