predict.ksmm: Predict Methods for Kernel Support Matrix Machines

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

View source: R/ksmm.R

Description

This function predicts values based upon a model trained by ksmm

Usage

1
	predict.ksmm(object, new_x, nCores = 1)

Arguments

object

Object of class 'ksmm', created by ksmm

new_x

input data matrix to test

nCores

the number of cores to use for parallel computing

Details

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

Author(s)

Kyuri Park

References

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

See Also

ksmm

Examples

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

X = as.matrix(nottingham[,-1])
y = ifelse(nottingham[,1] == 1, 1, -1)
train_x = X[c(1,100),]
train_y = y[c(1,100)]
test_x = X[2,]
test_y = y[2]

ksmm_fit = ksmm(train_x, train_y, c(200,200), 1, 1, 'rbf', 100, 1, 5e-2)
ksmm_pred_y = predict.ksmm(object = ksmm_fit, new_x = test_x, nCores = 1)
table(ksmm_pred_y, test_y)

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