glob_cr_vis {viralx}R Documentation

Global Visualization of SHAP Values for Cubist Rules Model

Description

This function generates a visualization for the global feature importance of a Cubist Rules (CR) model trained on HIV data with specified hyperparameters.

Usage

glob_cr_vis(vip_featured, hiv_data, cr_hyperparameters, vip_train, v_train)

Arguments

vip_featured

The name of the response variable to explain.

hiv_data

The training dataset containing predictor variables and the response variable.

cr_hyperparameters

A list of hyperparameters for the CR model, including:

  • committees: The number of committees to consider.

  • neighbors: The number of neighbors to consider.

vip_train

The dataset used for training the CR model.

v_train

The response variable used for training the CR model.

Value

A visualization of global feature importance for the CR model.

Examples

library(dplyr)
library(rules)
library(Cubist)
set.seed(123)
hiv_data <- train2
cr_hyperparameters <- list(neighbors = 5, committees = 58)
vip_featured <- c("cd_2022")
vip_features <- c("cd_2019", "vl_2019", "cd_2021", "vl_2021", "vl_2022")
vip_train <- train2 |>
dplyr::select(rsample::all_of(vip_features))
v_train <- train2 |>
dplyr::select(rsample::all_of(vip_featured))
glob_cr_vis(vip_featured, hiv_data, cr_hyperparameters, vip_train, v_train)

[Package viralx version 1.3.0 Index]