Questions tagged [kernlab]

The kernlab package for R provides kernel-based machine learning methods for classification, regression and clustering.

The kernlab package for R provides kernel-based machine learning methods for classification, regression, clustering, novelty detection, quantile regression and dimensionality reduction. Among other methods kernlab includes Support Vector Machines, Spectral Clustering, Kernel PCA, Gaussian Processes and a QP solver.

Resources:

84 questions
17
votes
1 answer

How to present multiple time-series data to an SVM (ksvm) in R (or, How to present two-dimensional input data to an SVM)

How can I make a ksvm model aware that the first 100 numbers in a dataset are all time series data from one sensor, while the next 100 numbers are all time series data from another sensor, etc, for six separate time series sensor inputs?…
phonetagger
  • 7,701
  • 3
  • 31
  • 55
15
votes
3 answers

Line search fails in training ksvm prob.model

Following up from Invalid probability model for large support vector machines using ksvm in R: I am training an SVM using ksvm from the kernlab package in R. I want to use the probability model, but during the sigmoid fitting I get the following…
roelandvanbeek
  • 659
  • 8
  • 20
13
votes
1 answer

Assign new data point to cluster in kernel k-means (kernlab package in R)?

I have a question about the kkmeans function in the kernlab package of R. I am new to this package and please forgive me if I'm missing something obvious here. I would like to assign a new data point to a cluster in a set of clusters that were…
carl5978
  • 131
  • 1
  • 3
12
votes
1 answer

Why are probabilities and response in ksvm in R not consistent?

I am using ksvm from the kernlab package in R to predict probabilities, using the type="probabilities" option in predict.ksvm. However, I find that sometimes using predict(model,observation,type="r") yields not the class with the highest probability…
roelandvanbeek
  • 659
  • 8
  • 20
8
votes
3 answers

Vastly different results for SVM model using e1071 and caret

I'm training two SVM models using two differnt packages on my data and getting vastly different results. Is this something to be expected? model1 using e1071 library('e1071') model1 <- svm(myFormula,…
user2175594
  • 799
  • 3
  • 9
  • 17
8
votes
2 answers

SVM Classification with Caret Error (Basic)

I am probably making a very simple (and stupid) mistake here but I cannot figure it out. I am playing with some data from Kaggle (Digit Recognizer) and trying to use SVM with the Caret package to do some classification. If I just plug the label…
mchangun
  • 9,814
  • 18
  • 71
  • 101
7
votes
4 answers

Help using predict() for kernlab's SVM in R?

I am trying to use the kernlab R package to do Support Vector Machines (SVM). For my very simple example, I have two pieces of training data. A and B. (A and B are of type matrix - they are adjacency matrices for graphs.) So I wrote a function which…
poundifdef
  • 18,726
  • 23
  • 95
  • 134
7
votes
1 answer

How to customize a kernel function in ksvm of kernlab package?

I have latitudes and longitudes, so I need to redefine the RBF kernel into exp(-1/2||sophere distrance||^2), which means I need to rewrite a kernel function myself. I write my kernel as follows: round.kernel <- function(x,y){ sigma <- 1 #R <-…
Yitong Zhou
  • 1,155
  • 4
  • 22
  • 42
6
votes
2 answers

predict with kernlab package error Error in .local(object, ...) : test vector does not match model R

I'm testing the kernlab package in a regression problem. It seems it's a common issue to get 'Error in .local(object, ...) : test vector does not match model ! when passing the ksvm object to the predict function. However I just found answers to…
nopeva
  • 1,583
  • 5
  • 22
  • 38
5
votes
1 answer

Kernlab kraziness: inconsistent results for identical problems

I've found some puzzling behavior in the kernlab package: estimating SVMs which are mathematically identical produces different results in software. This code snippet just takes the iris data and makes it a binary classification problem for the sake…
Sycorax
  • 1,298
  • 13
  • 26
5
votes
1 answer

Tuning ksvm from kernlab

I want to use an SVM implementation in R to do some regression. I tried using svm from e1071 already but I am limited by the kernel functions there. So I moved on to ksvm from kernlab. But I have a major disadvantage that a tuning function has not…
GaidinD
  • 354
  • 6
  • 18
5
votes
1 answer

R: SVM performance using custom kernel (user defined kernel) is not working in kernlab

I'm trying to use user defined kernel. I know that kernlab offer user defined kernel(custom kernel functions) in R. I used data spam including package kernlab. (number of variables=57 number of examples =4061) I'm defined kernel's…
4
votes
1 answer

probability model in kernlab::ksvm

For classification tasks in kernlab::ksvm, the default SVM used is C-svm (LIBSVM, Chang & Lin), which calculates a binary classification task. This can be extended to multiclass problems by calculating multiple 1 vs many binary classifiers and…
alexwhitworth
  • 4,839
  • 5
  • 32
  • 59
4
votes
2 answers

R caret unusually slow when tuning SVM with linear kernel

I have observed a very strange behavior when tuning SVM parameters with caret. When training a single model without tuning, SVM with radial basis kernel takes more time than SVM with linear kernel, which is expected. However, when tuning SVM with…
user1642513
4
votes
1 answer

kernel matrix computation outside SVM training in kernlab

I was developing a new algorithm that generates a modified kernel matrix for training with a SVM and encountered a strange problem. For testing purposes I was comparing the SVM models learned using kernelMatrix interface and normal kernel…
jMathew
  • 1,057
  • 8
  • 13
1
2 3 4 5 6