Description Usage Arguments Value Examples
View source: R/interactionMatrix.R
Creates a matrix displaying Variable importance on the diagonal and Variable Interaction on the off-diagonal.
1 2 3 4 5 6 7 8 9 10 11 12 |
task |
Task created from the mlr3 package, either regression or classification. |
model |
A machine learning model created from mlr3 task and learner. |
gridSize |
The size of the grid for evaluating the predictions. |
normalize |
Should the variances explained be normalized? Default is FALSE. |
nmax |
Maximum number of data rows to consider. |
sqrt |
In order to reproduce Friedman's H statistic, resulting values are root transformed. Set to FALSE if squared values should be returned. |
reorder |
If TRUE (default) uses DendSer to reorder the matrix of interactions and variable importances. |
main |
Define main category for classification. |
A matrix of values
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 graph:
plot(myMat, type = "heatMap")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.