Description Usage Arguments Details Author(s) References See Also Examples
This function predicts values based upon a model trained by ksmm
1 | predict.ksmm(object, new_x, nCores = 1)
|
object |
Object of class 'ksmm', created by |
new_x |
input data matrix to test |
nCores |
the number of cores to use for parallel computing |
This code is built by KSMM paper. Detailed theory is included in the KSMM paper
Kyuri Park
Ye, Y. (2019). A nonlinear kernel support matrix machine. International Journal of Machine Learning and Cybernetics.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.