ksmm: Kernel Support Matrix Machine

Description Usage Arguments Details Author(s) References See Also Examples

View source: R/ksmm.R

Description

ksmm is used to train a kernel support matrix machine. It can be used to carry out classification.

Usage

1
2
	ksmm(x = NULL, y, K = NULL, x_dim, cost, kernel = c("linear", "rbf"), sigma = 1,
                maxit = 1e+4, epsilon = 5e-2, init_alpha = 1e-6, nCores = 1, ...)

Arguments

x

a input data matrix

y

a response vector with one label for each row / component of X. It must be 1 or -1

K

the calculated kernel matrix. If you don't input anything, it works automatically.

x_dim

the size of input matrix X

cost

cost of constraints violation

kernel

type of the kernel used in training.

  • linear : linear kernel.

  • rbf : Gaussian RBF kernel.

sigma

kernel width for the Radial Basis kernel function "rbf"

maxit

a maximum number of iteration for SMO algorithm

epsilon

a minimum value for optimization

init_alpha

initialization of alpha

nCores

the number of cores to use for parallel computing.

...

currently not used.

Details

This function is built by KSMM paper. Detailed theory is included in the KSMM paper.

Author(s)

Kyuri Park (based on Matlab code by Yunfei Ye)

References

Ye, Y. (2019). A nonlinear kernel support matrix machine. International Journal of Machine Learning and Cybernetics.

See Also

make_ksmm_kernel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
require(ksmm)
data(nottingham)

X = as.matrix(nottingham[,-1])
y = ifelse(nottingham[,1] == 1, 1, -1)
train_x = X[1,]
train_y = y[1]

ksmm_fit = ksmm(train_x, train_y, c(200,200), 1, 1, 'rbf', 100, 1, 5e-2)
    	

kyuridata/ksmm documentation built on Dec. 21, 2021, 8:47 a.m.