View source: R/ranger_reg_plot.R
plot_reg_feature_selection | R Documentation |
Plot the regression performance against the reduced number of features used in the modeling.
plot_reg_feature_selection( x, y, rf_reg_model, nfolds = 5, metric = "MAE", unit = NA, outdir = NULL )
x |
The data frame or data matrix for model training. |
y |
The numeric values for labeling data. |
rf_reg_model |
The rf regression model from |
nfolds |
The number of folds in the cross-validation for each feature set. |
metric |
The regression performance metric applied. This must be one of "MAE", "RMSE", "MSE", "MAPE". |
unit |
The unit of numeric metadata variables that can be printed in the output figure. |
outdir |
The output directory. |
Shi Huang
set.seed(123) require("gtools") n_features <- 100 prob_vec <- rdirichlet(5, sample(n_features)) x <- data.frame(rbind(t(rmultinom(7, 7*n_features, prob_vec[1, ])), t(rmultinom(8, 8*n_features, prob_vec[2, ])), t(rmultinom(15, 15*n_features, prob_vec[3, ])), t(rmultinom(15, 15*n_features, prob_vec[4, ])), t(rmultinom(15, 15*n_features, prob_vec[5, ])))) y<- 1:60 rf_reg_model<-rf.out.of.bag(x, y) rf_reg_model<-rf.cross.validation(x, y) fs_summ <- plot_reg_feature_selection(x, y, rf_reg_model, metric="MAE", outdir=NULL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.