Description Usage Arguments Examples
View source: R/interactionPlot.R
Plots a selected variable against all other variables in a model
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
model |
A machine learning model created from mlr3 task and learner. |
interactionType |
Are measures based on Friedman's H statistic ("H") or on "ice" curves? |
pal |
A vector of colors to show values, for use with scale_fill_gradientn |
fitlims |
Specifies the fit range for the color map for interaction strength. |
gridSize |
The size of the grid for evaluating the predictions. |
normalize |
Should the variances explained be normalized? Default is FALSE. |
n_max |
Maximum number of data rows to consider. |
seed |
An integer random seed used for subsampling. |
sqrt |
In order to reproduce Friedman's H statistic, resulting values are root transformed. Set to FALSE if squared values should be returned. |
type |
The type of plot to display, either "lollipop" (default) or "barplot". |
title |
A title to be placed on the plot |
label |
Only compatible with plotType = "barplot". If TRUE then the interaction value is displayed at the end of each bar. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # 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 plot:
interactionPlot(aq_Task, aq_Mod)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.