sirus.plot.cv: Plot SIRUS cross-validation path.

View source: R/sirus.R

sirus.plot.cvR Documentation

Plot SIRUS cross-validation path.

Description

Plot SIRUS cross-validation path: error and stability versus the number of rules when p0 varies.

Usage

sirus.plot.cv(sirus.cv.grid, p0.criterion = NULL, num.rule.max = 25)

Arguments

sirus.cv.grid

Cross-validation results returned by sirus.cv.

p0.criterion

Criterion to pick the optimal p0 displayed in the plots: if 'pred' then p0.pred is used for a minimal error, if 'stab' then p0.stab is used for a tradeoff error/stability. Default is 'pred' for classification and 'stab' for regression.

num.rule.max

Upper limit on the number of rules for the x-axis. Default is 25.

Details

Error is 1-AUC for classification and the unexplained variance for regression. Stability is the average proportion of rules shared by two SIRUS models fit on two distinct folds of the cross-validation.

Value

Plots of cross-validation results.

error

plot of error vs number of rules (ggplot2 object).

stability

plot of stability vs number of rules (ggplot2 object).

Examples

## load SIRUS
require(sirus)

## prepare data
data <- iris
y <- rep(0, nrow(data))
y[data$Species == 'setosa'] = 1
data$Species <- NULL

## run cv
cv.grid <- sirus.cv(data, y, nfold = 3, ncv = 2, num.trees = 100)

## plot cv result
plot.error <- sirus.plot.cv(cv.grid)$error
plot(plot.error)


sirus documentation built on June 13, 2022, 5:07 p.m.