oscar.cv.visu {oscar}R Documentation

Visualize cross-validation as a function of k

Description

This function plots the model performance as a function of cardinality for k-fold cross-validation. Performance metric depends on user choice and model family (i.e. lower MSE is good, higher C-index is good).

Usage

oscar.cv.visu(
  cv,
  add = FALSE,
  main = "OSCAR cross-validation",
  xlab = "Cardinality 'k'",
  ylab = "CV performance",
  ...
)

Arguments

cv

Matrix produced by oscar.cv; rows are cv-folds, cols are k-values

add

Should plot be added on top of an existing plot device

main

Main title

xlab

X-axis label

ylab

Y-axis label

...

Additional parameters passed on top the CV points

Value

This is a plotting function that does not return anything, but instead draws on an existing or a new graphics device.

Examples

if(interactive()){
  data(ex)
  fit <- oscar(x=ex_X, y=ex_Y, k=ex_K, w=ex_c, family='cox')
  fit_cv <- oscar.cv(fit, fold = 10, seed = 123)
  oscar.cv.visu(fit_cv)
}

[Package oscar version 1.2.1 Index]