The gain curve to evaluate the unemployment model
In the previous exercise you made predictions about female_unemployment and visualized the predictions and the residuals.
Now, you will also plot the gain curve of the unemployment_model's predictions against actual female_unemployment using the WVPlots::GainCurvePlot() (docs) function.
For situations where order is more important than exact values, the gain curve helps you check if the model's predictions sort in the same order as the true outcome.
Calls to the function GainCurvePlot() look like: 
GainCurvePlot(frame, xvar, truthvar, title)
where
- frameis a data frame
- xvarand- truthvarare strings naming the prediction and actual outcome columns of- frame
- titleis the title of the plot
When the predictions sort in exactly the same order, the relative Gini coefficient is 1. When the model sorts poorly, the relative Gini coefficient is close to zero, or even negative.
The data frame unemployment, which also contains the predictions, and the model unemployment_model are available for you to use.
Este exercício faz parte do curso
Supervised Learning in R: Regression
Instruções do exercício
- Load the package WVPlotsusinglibrary().
- Plot the gain curve. Give the plot the title "Unemployment model". Do the model's predictions sort correctly?
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# unemployment (with predictions) is available
summary(unemployment)
# unemployment_model is available
summary(unemployment_model)
# Load the package WVPlots
___
# Plot the Gain Curve
___(___, ___, ___, "Unemployment model")