Displaying 20 results from an estimated 2000 matches similar to: "Pasting with Quotes"
2008 Jun 25
1
stringdot
Hi!!
I am trying to figure out how to use the string kernel "stringdot" in kernlab.
k <- function(x,y) {
(sum(x*y) +1)*exp(-0.001*sum((x-y)^2))
}
class(k) <- "kernel"
data(promotergene)
## train svm using custom kernel
gene.k <- ksvm(Class~.,data=promotergene,kernel=k,C=10,cross=5) # works fine in this case
gene.rbf <-
2009 Oct 23
1
Data format for KSVM
Hi,
I have a process using svm from the e1071 library. it works.
I want to try using the KSVM library instead. The same data used wiht
e1071 gives me an error with KSVM.
My data is a data.frame.
sample code:
svm_formula <- formula(y ~ a + B + C)
svm_model <- ksvm(formula, data=train_data, type="C-svc",
kernel="rbfdot", C=1)
I get the following error:
2009 Dec 25
2
Help with SVM package Kernlab
Hi useR's,
I am resending this request since I got no response for my last post and I
am new to the list so pardon me if I am violating the protocol.
I am trying to use the "Kernlab" package for training and prediction using
SVM's. I am getting the following error when I am trying to use the predict
function:
> predictSvm = predict(modelforSVM, testSeq);
Error in
2012 Aug 19
1
kernlab | ksvm error
Dear list,
I am using the ksvm function from kernlab as follows:
(1) learning
> svm.pol4 <- ksvm(class.labs ~ ., data = train.data, prob.model = T, scale
= T, kernel = "polydot")
(2) prediction
> svm.pol.prd4 <- predict(svm.pol4, train.data, type = "probabilities")[,2]
But unfortunately, when calling the prediction, once in every 10s of times
(using the exact
2012 Nov 15
1
Can't see what i did wrong..
with
pred.pca<-predict(splits[[i]]$pca,trainingData at samples)[,1:nPCs]
dframe<-as.data.frame(cbind(pred.pca,class=isExplosive(trainingData,2)));
results[[i]]$classifier<-ksvm(class~.,data=dframe,scaled=T,kernel="polydot",type="C-svc",
C=C,kpar=list(degree=degree,scale=scale,offset=offset),prob.model=T)
and a degree of 5 i get an error of 0 reported by the ksvm
2011 Jan 24
5
Train error:: subscript out of bonds
Hi,
I am trying to construct a svmpoly model using the "caret" package (please
see code below). Using the same data, without changing any setting, I am
just changing the seed value. Sometimes it constructs the model
successfully, and sometimes I get an ?Error in indexes[[j]] : subscript out
of bounds?.
For example when I set seed to 357 following code produced result only for 8
2009 Sep 06
2
Regarding SVM using R
Hi Abbas,
Before I try to give you answers, I just want to mention that you
should send R related reqests to the R-help list, and not me
personally because (i) there's a greater likelihood that it will get
answered in a timely manner, and (ii) people who might have a similar
problem down the road might benefit from any answer via searching the
list archives ... anyway:
On Sep 5, 2009, at
2007 Sep 12
0
one-class SVM in kernlab
Hello,
I'm trying to using ksvm() in the kernlab package to fit a one-class
SVC, but I get a strage result on the cross-validation error estimate.
For example, consider this code:
data(spam)
classifier <- ksvm(type~.,data=spam[which(spam[,'type']=='spam'),],
type="one-svc",kernel="rbfdot",kpar=list(sigma=0.1),nu=0.05,cross=10)
what I get is:
>
2013 Nov 15
1
Inconsistent results between caret+kernlab versions
I'm using caret to assess classifier performance (and it's great!). However, I've found that my results differ between R2.* and R3.* - reported accuracies are reduced dramatically. I suspect that a code change to kernlab ksvm may be responsible (see version 5.16-24 here: http://cran.r-project.org/web/packages/caret/news.html). I get very different results between caret_5.15-61 +
2012 Jul 31
1
kernlab kpca predict
Hi!
The kernlab function kpca() mentions that new observations can be transformed by using predict. Theres also an example in the documentation, but as you can see i am getting an error there (As i do with my own data). I'm not sure whats wrong at the moment. I haven't any predict functions written by myself in the workspace either. I've tested it with using the matrix version and the
2010 Sep 24
0
kernlab:ksvm:eps-svr: bug?
Hi,
A. In a nutshell:
The training error, obtained as "error (ret)", from the return value
of a ksvm () call for a eps-svr model is (likely) being computed
wrongly. "nu-svr" and "eps-bsvr" suffer from this as well.
I am attaching three files: (1) ksvm.R from the the kernlab package,
un-edited, (2) ksvm_eps-svr.txt: (for easier reading) containing only
eps-svr
2007 Aug 14
0
kernlab ksvm() cross-validation prediction response vector
Hello,
I would like to know, whether for the support vector classification function ksvm()
the response values stored in object at ymatrix are cross validated outputs/predictions:
Example code from package kernlab, function ksvm:
library(kernlab)
## train a support vector machine
filter <- ksvm(type~.,data=spam,kernel="rbfdot",kpar=list(sigma=0.05),C=5,cross=3)
filter
filter at
2009 Nov 29
2
kernlab's ksvm method freeze
Hello,
I am using kernlab to do some binary classification on aminoacid
strings.
I am using a custom kernel, so i use the kernel="matrix" option of the
ksvm method.
My (normalized) kernel matrix is of size 1309*1309, my results vector
has the same length.
I am using C-svc.
My kernlab call is something similiar to this:
ksvm(kernel="matrix", kernelMatrix, trainingDataYs,
2009 Dec 24
0
Error with Package "Kernlab" for SVM prediction
Hi All,
I am trying to use the "Kernlab" package for training and prediction using
SVM's. I am getting the following error when I am trying to use the predict
function:
> predictSvm = predict(modelforSVM, testSeq);
Error in `contrasts<-`(`*tmp*`, value = "contr.treatment") :
contrasts can be applied only to factors with 2 or more levels
The training file is a
2009 Apr 28
1
kernlab - custom kernel
hi,
I am using R's "kernlab" package, exactly i am doing classification using
ksvm(.) and predict.ksvm(.).I want use of custom kernel. I am getting some
error.
# Following R code works (with promotergene dataset):
library("kernlab")
s <- function(x, y) {
sum((x*y)^1.25)
}
class(s) <- "kernel"
data("promotergene")
gene <- ksvm(Class ~ .,
2010 Mar 16
2
Missing index in vector assignment
Dear r-helpers,
I am getting a mismatch error between two variables:
svp <- ksvm(x, y, type="nu-svc")
Error in .local(x, ...) : x and y don't match.
and I suspect that it might be due to missing index in the y variable which
I defined as:
y <- (LVvar[,1])
I tried various methods to make the y assignment in the same format as x,
which is a dataframe
x <-
2011 Aug 26
1
kernlab: ksvm() bug?
Hello all,
I'm trying to run a gird parameter search for a svm.
Therefore I'M using the ksvm function from the kernlab package.
----
svp <- ksvm(Ktrain,ytrain,type="nu-svc",nu=C)
----
The problem is that the optimization algorithm does not return
for certain parameters.
I tried to use setTimeLimit() but that doesn't seem to help.
I suspect that ksvm() calls c code that
2009 Jul 08
1
ksvm question -- help! line search failed...
I got the data working, but now I got another problem with KSVM:
line search fails -2.793708 -0.5831701 1.870406e-05 -5.728611e-06
-5.059796e-08 -3.761822e-08 -7.308871e-13Error in
prob.model(object)[[p]]$A :
$ operator is invalid for atomic vectors
On Tue, Jul 7, 2009 at 6:45 PM, Steve
Lianoglou<mailinglist.honeypot at gmail.com> wrote:
> Hi,
>
> On Jul 7, 2009, at 6:44 PM,
2012 Sep 14
1
Plotting DMAs (Direct Marketing Areas)
Hey useRs!
Do any of you guys know how to plot DMAs within R (preferrably within the
maps() package)? I haven't been able to find any resources on this, but I
apologize if this is a dumb question and I'm overlooking the obvious
answer. Thanks for your help!
Josh
[[alternative HTML version deleted]]
2006 Nov 24
1
How to find AUC in SVM (kernlab package)
Dear all,
I was wondering if someone can help me. I am learning SVM for
classification in my research with kernlab package. I want to know about
classification performance using Area Under Curve (AUC). I know ROCR
package can do this job but I found all example in ROCR package have
include prediction, for example, ROCR.hiv {ROCR}. My problem is how to
produce prediction in SVM and to find