dbvsmsvm: Derivative-based variable selection for the angle-based...

Description Usage Arguments Value Examples

View source: R/dbvsmsvm.R

Description

Derivative-based variable selection for the angle-based multicategory support vector machines with reinforced multicategory loss.

Usage

1
2
3
4
5
6
dbvsmsvm(x, y, gamma = 0.5, valid_x = NULL, valid_y = NULL, nfolds = 10, 
	 lambda_seq = 2^{seq(-10, 15, length.out = 100)},
	 v_seq = NULL, Nofv = 100, u_seq = NULL, Nofu = 100,
	 kernel = c("linear", "gaussian"), kparam = 1, scale = FALSE, 
	 criterion = c("0-1", "hinge"), cv_type = c("standard", "osr"), 
	 interaction = FALSE, optModel = FALSE, nCores = 1, ...)

Arguments

x

A n x p data matrix, where n is the number of observations and p is the number of variables.

y

A response variable with three and more labels.

gamma

The convex combination parameter of the loss function.

valid_x

A validation data matrix for selecting lambda and threshold parameter v (optional). If valid_x=NULL, nfolds-fold cross-validation is performed.

valid_y

A validation response vector (optional).

nfolds

The number of folds for cross-validation.

lambda_seq

A sequence of regularization parameter to control a level of l_2-penalty.

v_seq

A sequence of threshold parameter to select informative variables.

Nofv

The number of threshold values. If v_seq is not given, a sequence of threshold parameter is automatically computed based on Nofv.

u_seq

A sequence of threshold parameter for interaction selection.

Nofu

The number of threshold values for interaction selection. If u_seq is not given, a sequence of threshold parameter is automatically computed based of Nofu.

kernel

A character string representing one of type of kernel.

kparam

A parameter needed for kernel.

scale

A logical value indicating whether to scale the variables. If scale=TRUE, x is scaled to zero mean and unit variance.

criterion

A type of criterion evaluating prediction performance of cross-validation.

cv_type

A rule of selecting threshold parameter. If cv_type="osr", one standard error rule is adopted.

interaction

A logical. Whether to select interaction terms.

optModel

A logical. Whether to obtain the optimal classification model.

nCores

The number of cores to use for parallel computing.

...

Other arguments that can be passed to ramsvm function.

Value

An S3 object of class "dbvsmsvm" containing the following slots

selected

A zero-one vector indicating the selected variables.

lambda_cv_inform

Information of cross-validation for lambda including cross-validation errors and optimal lambda value.

selection_cv_inform

Information of cross-validation for threshold parameter including cross-validation errors and optimal threshold value.

interaction_selection_cv_inform

Information of cross-validation for threshold parameter of interaction selection including cross-validation errors and optimal threshold value.

opt_model

If optModel=TRUE, classification model with the optimal lambda and threshold parameter is returned.

opt_valid_err

If optModel=TRUE, a minimum value of cross-validation errors based on the selected variables is returned.

valid_err

If optModel=TRUE, cross-validation errors based on the selected variables is returned.

cv_type

A rule of selecting threshold parameter.

call

The call of dbvsmsvm.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
require(dbvsmsvm)
n = 100; p = 10;
data = dbvsmsvm:::sim_gen(n = n, p = p, type = "linear")
x = scale(data$x)
y = data$y
sigma = kernlab::sigest(y ~ x, scaled = FALSE)[3]

# Fit the DBVS-MSVM with the linear kernel
dbvs_linear = dbvsmsvm(x = x, y = y, nfolds = 5, lambda_seq = 2^{seq(-20, 0, length.out = 100)},
                       Nofv = 100, kernel = "linear", criterion = "0-1", scale = FALSE,
                       cv_type = "osr", interaction = FALSE, gamma = 0.5, optModel = FALSE, nCores = 1)

# Fit the DBVS-MSVM with the Gaussian kernel
dbvs_radial = dbvsmsvm(x = x, y = y, nfolds = 5, lambda_seq = 2^{seq(-20, 0, length.out = 100)},
                       Nofv = 100, kernel = "gaussian", kparam = sigma, criterion = "0-1", scale = FALSE,
                       cv_type = "osr", interaction = FALSE, gamma = 0.5, optModel = TRUE, nCores = 1)

# Fit the DBVS-MSVM with the Gaussian kernel for selecting second-order interaction
dbvs_interaction = dbvsmsvm(x = x, y = y, nfolds = 5, lambda_seq = 2^{seq(-20, 0, length.out = 100)},
                            Nofv = 100, kernel = "gaussian", kparam = sigma, criterion = "0-1", scale = FALSE,
                            cv_type = "osr", interaction = TRUE, gamma = 0.5, optModel = FALSE, nCores = 1)

bbeomjin/GBFSMSVM documentation built on Nov. 7, 2021, 10:20 p.m.