search for: ksvm

Displaying 20 results from an estimated 56 matches for "ksvm".

Did you mean: ksm
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: &quot...
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, type="C-svc", cross=10, C=2) To this point, everything wor...
2008 Sep 14
0
ksvm accessing the slots of S4 object
I am using kernlab to build svm models. I am not sure how to access the different slots of the object. For instance if I want to get the nuber of support vectors for each of model I am building and store it in a vector. >ksvm.model <- ksvm(Class ~ ., data = somedata,kernel = "vanilladot", cross = 10, type ="C-svc") >names(attributes(ksvm.model)) [1] "param" "scaling" "coef" "alphaindex" "b" [6] "obj" "SVindex...
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 d...
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, &...
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 c...
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 fil...
2007 Oct 30
0
kernlab/ ksvm: class.weights & prob.model in binary classification
Hello list, I am faced with a two-class classification problem with highly asymetric class sizes (class one: 99%, class two: 1%). I'd like to obtain a class probability model, also introducing available information on the class prior. Calling kernlab/ksvm with the line > ksvm_model1<-ksvm(as.matrix(slides), as.factor(Class), class.weights= c("0" =99, "1" =1), prob.model=T) > or > ksvm_model1<-ksvm(as.matrix(slides), as.factor(Class), class.weights=wts, prob.model=T) > with the named vector wts 0 1 99 1...
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 ~ .,...
2007 Aug 08
0
ksvm-kernel
HI I am new to R. I have one problem in the predict function of the kernlab. I want to use ksvm and predict with kernelmatrix (S4 method for signature 'kernelMatrix') #executing the following sentences library(kernlab) # identity kernel k <- function(x,y) { n<-length(x) cont<-0 for(i in 1:n){ if(x[i]==y[i]){ cont<-cont+1 } } cont } class(k) &lt...
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 <- ksvm(Class~.,data=promotergene,kernel="rbfdot",C=10,cross=5)# works fine with the rbf kernel gene.string <- ksvm(Class~.,data=promotergene,kernel="stringdot",C=10,cross=5) # this giv...
2009 Jul 07
1
ksvm question -- help! cannot get program to run...
What's wrong? Very sad about this... model <- ksvm(x=mytraindata[, -1], y=factor(mytraindata[, 1]), prob.model=T) Error in .local(x, ...) : x and y don't match.
2009 Oct 06
0
Kernlab: multidimensional targets in rvm(), ksvm(), gausspr()
Hi there, I'm trying to do a regression experiment on a multidimensional dataset where both x and y in the model are multidimensional vectors. I'm using R version 2.9.2, updated packages, on a Linux box. I've tried gausspr(), ksvm() and rvm(), and the models are computed fine, but I'm always getting the same error message when I try to use predict(): "Error in .local(object, ...) : test vector does not match model !" I realize that maybe kernlab does not support the kind of operation I'm trying to do, but...
2010 Jun 11
1
Decision values from KSVM
Hi, I'm working on a project using the kernlab library. For one phase, I want the "decision values" from the SVM prediction, not the class label. the e1071 library has this function, but I can't find the equivalent in ksvm. In general, when an SVM is used for classification, the label of an unknown test-case is decided by the "sign" of its resulting value as calculated from the SVM {-,+} I want the actual values as a proximal representation of the "strength" of the decision. (Further from the hyp...
2011 May 28
0
how to train ksvm with spectral kernel (kernlab) in caret?
...set.seed(2) fitControl$summaryFunction<- Rand svmNew<- train(TrainData, TrainClasses, method = "svmRadial", preProcess = c("center", "scale"), metric = "cRand", tuneLength = 4) svmNew ------------------- here is an example on how to train the ksvm with spectral kernel ------------------- # Load the data data(reuters) y <- rlabels x <- reuters sk <- stringdot(type="spectrum", length=4, normalized=TRUE) svp <- ksvm(x,y,kernel=sk,scale=c(),cross=5) svp ----------------- Does anyone know how I can train the svm from abov...
2012 Aug 27
0
kernlab`s custom kernel of ksvm freeze
...ues that are inverse of standard deviation vector about each variables. (ex: v=(0.1666667,........0.1666667)`, length(v)= 57) training set defined 60% of spam data. (preserving the proportions of the different classes.) if data's type is spam, than data`s type = 1 for train svm (else -1) m=ksvm(xtrain,ytrain,type="C-svc",kernel=kp,C=10) But, this step is not working. always Waiting for a response. So, I ask you this problem, why? number of examples are too big? Is there any other R package that can train SVMs for user defined kernel? I want to your answer. Thanks in adv...
2012 May 05
2
Pasting with Quotes
Hello useRs! So, I have a random question. I'm trying to build a character string, then evaluate it. I think an example would be the easiest way to explain: kern.vec = c("rbfdot","polydot") for( j in 1:length( kern.vec ) ) { formula = paste("ksvm( ind ~ . , data=d.temp[,c(ind_col,dep_cols)], kernel =",kern.vec[j],", prob.model=T )") svm = eval( parse( text=formula ) ) ... } The problem I always seem to have is that in the formula, I need to have quotes around "rbfdot" (for example). But, when I...
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 pertinent blocks...
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",k...
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 &...