Instance-level explanations
Robert Lewandowski
Here are player attributes for R Lewankdowski:
Now we’ll explore instance-level explanations based on the deep GBM model.
Break-down plot:
fifa_bd_gbm <- predict_parts(fifa_gbm_exp_deep,
new_observation = fifa["R. Lewandowski",],
type = "break_down")
plot(fifa_bd_gbm) +
scale_y_continuous("Predicted value in Euro",
labels = dollar_format(suffix = "€", prefix = "")) +
ggtitle("Break-down plot for Robert Lewandowski","")
Recall that BD plots are sensitive to the ordering of variables.
Shapley Values:
fifa_shap_gbm <- predict_parts(fifa_gbm_exp_deep,
new_observation = fifa["R. Lewandowski",],
type = "shap")
plot(fifa_shap_gbm, show_boxplots = TRUE) +
scale_y_continuous("Estimated value in Euro",
labels = dollar_format(suffix = "€", prefix = "")) +
ggtitle("Shapley values for Robert Lewandowski","")
Shapley values are not sensitive to variable order.
In this case, there is fairly broad agreement in the top variables across the BD plot and Shapley values.
CP Profiles:
selected_variables <- c("movement_reactions", "skill_ball_control", "skill_dribbling", "age")
fifa_cp_gbm <- predict_profile(fifa_gbm_exp_deep,
new_observation = fifa["R. Lewandowski",],
variables = selected_variables)
plot(fifa_cp_gbm, variables = selected_variables)
Local fidelity plot:
The distribution between R Lewandowski’s neighbors and the total population appears to be different. We see more extreme values among the nearest neighbors compared to the overall population.
Asymptotic two-sample Kolmogorov-Smirnov test
data: residuals_other and residuals_sel
D = 0.40219, p-value = 0.0001539
alternative hypothesis: two-sided
Local Stability plot for age:
CP profiles among similar players share a similar relationship between value and age.
id_rf_age <- individual_diagnostics(fifa_gbm_exp_deep, fifa_small["R. Lewandowski",],
neighbors = 30, variables = "age")
plot(id_rf_age) +
scale_y_continuous("Estimated value in Euro", trans = "log10",
labels = dollar_format(suffix = "€", prefix = "")) +
ggtitle("Local-stability plot for Robert Lewandowski", "")
Note: The book chapter provides instance-level explanations for a couple of other players: Christiano Ronaldo (CR7) and Wojciech Szczesny.
For the sake of brevity we’ll look at one more player, Lionel Messi, as the book suggested this player as an additional exercise. Code snippets are hidden.
Lionel Messi
Lionel Messi’s attributes:
Break-down plot:
Shapley Values:
CP Profiles:
Local fidelty plot:
Asymptotic two-sample Kolmogorov-Smirnov test
data: residuals_other and residuals_sel
D = 0.41913, p-value = 6.814e-05
alternative hypothesis: two-sided
Local stability plot for age