svmroc_cv: Estimate SVM ROC curve using cross-validation

Description Usage Arguments Value

View source: R/svmroc_cv.R

Description

svmroc_cv estimates the SVM ROC curve using cross-validation.

Usage

1
2
3
svmroc_cv(X, A, kernel = "linear", fold_id = NULL, num_folds_roc = 10,
  lambdas = c(0.1, 0.25, 0.5, 1), sigmas = c(0.1, 0.25, 0.5, 1),
  num_folds_params = 10, weights = seq(0.01, 0.99, 0.01), seed = NULL)

Arguments

X

A matrix of covariates used for fitting the SVM.

A

A factor with two levels or an object that can be coerced to a factor with two levels; used as the response when fitting the SVM.

kernel

The kernel used for fitting the SVM, either "linear" or "Gaussian". Defaults to "linear".

fold_id

A vector indicating which fold each observation belows to when estimating the ROC curve. If NULL, folds are generated randomly. Defaults to NULL

num_folds_roc

Number of folds used to estimate ROC curve. Ignored if fold_id is not NULL. Defaults to 10.

lambdas

A numeric vector of penalty parameters to select from. Defaults to c(0.1, 0.25, 0.5, 1).

sigmas

A numeric vector of bandwidth parameters to select from. Defaults to c(0.1, 0.25, 0.5, 1).

num_folds_params

Number of folds for cross-validation to select tuning parameters. Defaults to 10.

weights

A vector of weights to use for the weighted SVM. Defaults to seq(0.01, 0.99, 0.01).

seed

Random number seed to set. If NULL, no seed is set. Defaults to NULL.

Value

An object of class svmroc, a list with only the following components: sens, a vector of sensitivities across weights, averaged across folds; spec, a vector of specificities across weights, averaged across folds.


djluckett/svmroc documentation built on Oct. 6, 2019, 12:42 a.m.