Description Usage Arguments Examples
View source: R/plot_feature_predictions.R
function to plot the prediction vs the actual over a given feature. This allows analysis of how well the predictions fit over the feature. This function DOES NOT give the marginal effect of a feature, this is due to correlations with other features
1 2 3 4 5 6 7 8 9 10 | plot_feature_predictions(
feature,
feature_name,
actual,
prediction,
weight = rep(1, length(feature)),
exposure_type = "pdf",
n_bins = 10,
use_plotly = TRUE
)
|
feature |
- vector of factor to be plotted over |
feature_name |
- Name of factor to be plotted over. Will be used to label plots |
actual |
- array[numeric] - target variable |
prediction |
- array[numeric] - prediction of target variable |
weight |
numeric - Vector of length |
exposure_type |
- character. either |
n_bins |
numeric - Vector of length 1 for 1D plot and 1 or 2 for 2D plots. This is the number of points to calculate the PDP for |
use_plotly |
Optional: boolean - If TRUE plotly object is returned else ggplot2 object |
1 2 3 4 | plot_feature_predictions(feature=rep(1:10, each = 10),
feature_name= "Example",
actual=1:100,
prediction=1:100 + 10 * rnorm(100))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.