| plot_contribution | R Documentation |
Creates a scatter plot showing each variable's actual contribution to the prediction. For each observation, the contribution is the sum of coefficient * basis function value across all terms involving that variable.
plot_contribution(earth_result, variable, response_idx = NULL)
earth_result |
An object of class |
variable |
Character string. Name of the predictor variable to plot. |
response_idx |
Integer or |
A ggplot2::ggplot object.
result <- fit_earth(mtcars, "mpg", c("cyl", "disp", "hp", "wt"))
plot_contribution(result, "wt")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.