Questions tagged [libsvm]

LIBSVM is a library for Support Vector Machines

LIBSVM is an integrated software for support vector classification, (C-SVC, nu-SVC), regression (epsilon-SVR, nu-SVR) and distribution estimation (one-class SVM). It supports multi-class classification. It comprises of both C++ and Java sources, and interfaces to several commonly used languages, such as Python, MATLAB, R, Ruby, Perl, PHP and Haskell.

1241 questions
6
votes
3 answers

How to perform 10 fold cross validation with LibSVM in R?

I know that in MatLab this is really easy ('-v 10'). But I need to do it in R. I did find one comment about adding cross = 10 as parameter would do it. But this is not confirmed in the help file so I am sceptical about it. svm(Outcome ~. , data=…
Sigvard
  • 85
  • 1
  • 6
6
votes
1 answer

libsvm - Cross validation accuracy same as the ratio of labels

I'm using the Python interface for libsvm, and what I'm noticing is that after selecting the best C and gamma parameters (RBF kernel) using grid search, when I train the model and cross validate it (5 fold, if it's relevant), the accuracy that I…
Siddhant
  • 2,535
  • 4
  • 20
  • 22
5
votes
1 answer

LIBLINEAR/LIBSVM "Wrong input format at line 1"

Hi i need help with my input file: checkdata.py return with "No errors" but still something is wrong. My first line looks like: +1 1:-1 2:-1 3:0.737705 4:1 5:0.737705 6:-0.959596 7:-0.757576 9:0.6875 10:0.487179 11:-0.6 12:-1 13:-0.27907 14:0.171717…
Philipp
  • 247
  • 2
  • 10
5
votes
2 answers

Which of the parameters in LibSVM is the slack variable?

I am a bit confused about the namings in the SVM. I am using this library LibSVM. There are so many parameters that can be set. Does anyone know which of these is the slack variable? thx
Hossein
  • 40,161
  • 57
  • 141
  • 175
5
votes
3 answers

python program to export numpy/lists in svmlight format

Any way to export a python array into SVM light format?
tomas
  • 665
  • 1
  • 10
  • 14
5
votes
2 answers

Accuracy of LibSVM decreases

After getting my testlabel and trainlabel, i implemented SVM on libsvm and i got an accuracy of 97.4359%. ( c= 1 and g = 0.00375) model = svmtrain(TrainLabel, TrainVec, '-c 1 -g 0.00375'); [predict_label, accuracy, dec_values] =…
lakshmen
  • 28,346
  • 66
  • 178
  • 276
5
votes
2 answers

An example of using LibSVM in java

I am considering using libsvm. Currently, I have transformed my feature vectors to SVM feature vectors format. I am using LibSVM inside a project I will need to somehow use it within my app. The problem is that at the moment all examples available…
Hossein
  • 40,161
  • 57
  • 141
  • 175
5
votes
1 answer

Is order of features in LibSVM feature vectors important?

I am considering using LibSVM and I am creating the required feature vectors. In almost all the example data there is an order for the features for example: +1 1:3 2:1 3:5 4:2 10:8 Was wondering if this ordering is important, for example: +1 4:2…
Hossein
  • 40,161
  • 57
  • 141
  • 175
5
votes
3 answers

LibSVM turns all my training vectors into support vectors, why?

I am trying to use SVM for News article classification. I created a table that contains the features (unique words found in the documents) as rows. I created weight vectors mapping with these features. i.e if the article has a word that is part of…
Krishna Chaitanya M
  • 227
  • 1
  • 6
  • 12
5
votes
1 answer

How to understand the format type of libsvm of Spark MLlib?

I am new for learning Spark MLlib. When I was reading about the example of Binomial logistic regression, I don't understand the format type of "libsvm". (Binomial logistic regression) The text looks like: 0 128:51 129:159 130:253 131:159 132:50…
5
votes
7 answers

Help me understand linear separability in a binary SVM

I'm cross-posting this from math.stackexchange.com because I'm not getting any feedback and it's a time-sensitive question for me. My question pertains to linear separability with hyperplanes in a support vector machine. According to…
Petrus Theron
  • 27,855
  • 36
  • 153
  • 287
5
votes
1 answer

R: How do we print percentage accuracy for SVM

Here is my sample R code: train <- read.csv("Train.csv") test <- read.csv("Test+.csv") x <- model.matrix(age ~ . - 1,data=train) classify=svm(as.factor(age)~ ., data=train,method="class") pred =…
Mahsolid
  • 433
  • 4
  • 12
  • 28
5
votes
3 answers

Train SVM on a very large dataset stored on hard drive

There exist a very large own-collected dataset of size [2000000 12672] where the rows shows the number of instances and the columns, the number of features. This dataset occupies ~60 Gigabyte on the local hard disk. I want to train a linear SVM on…
Saeed
  • 742
  • 1
  • 7
  • 21
5
votes
2 answers

Support vector machine in Python using libsvm example of features

I have scraped a lot of ebay titles like this one: Apple iPhone 5 White 16GB Dual-Core and I have manually tagged all of them in this way B M C S NA where B=Brand (Apple) M=Model (iPhone 5) C=Color (White) S=Size (Size) NA=Not Assigned (Dual…
Usi Usi
  • 2,967
  • 5
  • 38
  • 69
5
votes
2 answers

Basic SVM Implemented in MATLAB

Linearly Non-Separable Binary Classification Problem First of all, this program isn' t working correctly for RBF ( gaussianKernel() ) and I want to fix it. It is a non-linear SVM Demo to illustrate classifying 2 class with hard margin…
mehmet
  • 1,631
  • 16
  • 21