Description Usage Arguments Examples
View source: R/importancePlot.R
This function is used to plot just the variable importance.
1 2 3 4 5 6 7 8 9 |
mat |
A matrix of values to be plotted. Either added by the user or created using the prepFunc() function. |
pal |
A vector of colors to show predictions, for use with scale_fill_gradientn |
fitlims |
Specifies the fit range for the color map for importance. |
top |
A value set by the user to only display the top x amount variables. |
label |
Only compatible with plotType = "barplot". If TRUE then the importance value is displayed at the end of each bar. |
... |
Not currently implemented |
type |
The type of plot to display, either "lollipop" (default), or "barplot". |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Load in the data:
aq <- data.frame(airquality)
aq <- na.omit(aq)
# Run an mlr ranger model:
library(mlr3)
library(mlr3learners)
library(ranger)
aq_Task <- TaskRegr$new(id = "airQ", backend = aq, target = "Ozone")
aq_lrn <- lrn("regr.ranger", importance = "permutation")
aq_Mod <- aq_lrn$train(aq_Task)
# Create matrix
myMat <- vividMatrix(task = aq_Task, model = aq_Mod)
# Create plot:
plot(myMat, type = "importance")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.