Description Usage Arguments Value Examples
Use lasvm to train a given problem.
1 | lasvmPredict(x, model, verbose = FALSE)
|
x |
data matrix |
model |
trained model |
verbose |
verbose output? |
a list consisting of predictions the predicted labels
1 2 3 4 5 6 7 8 9 10 | model = simanle::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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.