sirus.plot.cv {sirus} | R 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 |
p0.criterion |
Criterion to pick the optimal |
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)