lasvmPredict: lasvmPredict

Description Usage Arguments Value Examples

Description

Use lasvm to train a given problem.

Usage

1
lasvmPredict(x, model, verbose = FALSE)

Arguments

x

data matrix

model

trained model

verbose

verbose output?

Value

a list consisting of predictions the predicted labels

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
model = lasvmR::lasvmTrain (x = as.matrix(iris[seq(1,150,2),1:4]),
	y = (as.numeric(iris[seq(1,150,2),5]) %% 2)*2-1,
	gamma = 1,
	cost = 1,
	kernel = 2)
ytrue = (as.numeric(iris[seq(2,150,2),5]) %% 2)*2-1
result = lasvmPredict (x = as.matrix(iris[seq(2,150,2),1:4]), model)
ypred = result$predictions
error = sum(abs(ypred - ytrue))/length(ytrue)
cat ("Error rate =", error*100)

aydindemircioglu/lasvmR documentation built on May 11, 2019, 4:14 p.m.