plot.Interaction function

Plot Interaction

Plot Interaction

plot.Interaction() plots the results of an Interaction object.

## S3 method for class 'Interaction' plot(x, sort = TRUE)

Arguments

  • x: An Interaction R6 object
  • sort: logical. Should the features be sorted in descending order? Defaults to TRUE.

Returns

ggplot2 plot object

Examples

# We train a tree on the Boston dataset: ## Not run: library("rpart") data("Boston", package = "MASS") rf <- rpart(medv ~ ., data = Boston) mod <- Predictor$new(rf, data = Boston) # Compute the interactions ia <- Interaction$new(mod) # Plot the results directly plot(ia) ## End(Not run)

See Also

Interaction

  • Maintainer: Giuseppe Casalicchio
  • License: MIT + file LICENSE
  • Last published: 2025-02-24