Learn R Programming

PatientLevelPrediction (version 4.3.10)

setSVM: Create setting for SVM with python

Description

Create setting for SVM with python

Usage

setSVM(
  kernel = "rbf",
  C = c(1, 0.9, 2, 0.1),
  degree = c(1, 3, 5),
  gamma = c(1e-04, 3e-05, 0.001, 0.01, 0.25),
  shrinking = T,
  coef0 = 0,
  classWeight = "balanced",
  varImp = F,
  seed = NULL
)

Arguments

kernel

Specifies the kernel type to be used in the algorithm. one of <U+2018>linear<U+2019>, <U+2018>poly<U+2019>, <U+2018>rbf<U+2019>, <U+2018>sigmoid<U+2019>, <U+2018>precomputed<U+2019>. If none is given <U+2018>rbf<U+2019> will be used.

C

penalty parameter C of the error term.

degree

degree of kernel function is significant only in poly, rbf, sigmoid

gamma

kernel coefficient for rbf and poly, by default 1/n_features will be taken.

shrinking

wether to use the shrinking heuristic.

coef0

independent term in kernel function. It is only significant in poly/sigmoid.

classWeight

Class weight based on imbalance either 'balanced' or 'none'

varImp

Whether to calculate the variable importance using PFI

seed

A seed for the model

Examples

Run this code
# NOT RUN {
model.svm <- setSVM(kernel='rbf', seed = NULL)
# }

Run the code above in your browser using DataLab