Description Usage Arguments Value Examples
This function plots the cross-validation curve for a series of models fit using crispCV
. The cross-validation error with +/-1 standard error is plotted for each value of lambda considered in the call to crispCV
with a dotted vertical line indicating the chosen lambda.
1 2 |
x |
An object of class |
showSE |
A logical value indicating whether the standard error of the curve should be plotted. |
... |
Additional arguments to be passed, which are ignored in this function. |
None.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
#See ?'crisp-package' for a full example of how to use this package
#generate data (using a very small 'n' for illustration purposes)
set.seed(1)
data <- sim.data(n = 15, scenario = 2)
#fit model and select lambda using 2-fold cross-validation
#note: use larger 'n.fold' (e.g., 10) in practice
crispCV.out <- crispCV(X = data$X, y = data$y, n.fold = 2)
#plot the cross-validation error
plot(summary(crispCV.out))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.