Session Ready
Exercise

Visualizing the linear regression

In the last chapter, you used the studentgradeprediction dataset to attempt to create a model using the student's study time to predict the final grades of high schoolers. In this chapter, you added on other attributes including the number of absences, free time (mins), and whether they lived in a Rural or Urban city. If you recall, the correlation in the simple linear regression was ~0.25.

In the last lesson, you completed your model evaluation. Now you'll visualize your model using predict() and evaluate whether adding additional attributes has increased the predictive power of your model.

Instructions
100 XP
  • Calculate the predicted values of your test data (studentgradeprediction_test).
  • Plot the actual and predicted values of your data. Note that you'll use as.numeric() to be able to plot the predictions from the Estimators model.
  • Calculate the correlation between the actual and predicted values.