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
5
votes
2 answers

Nominal Attributes in LibSVM

When creating a libsvm training file, how do you differentiate between a nominal attribute verses a numeric attribute? I'm trying to encode certain nominal attributes as integers, but I want to ensure libsvm doesn't misinterpret them as numeric…
Cerin
  • 60,957
  • 96
  • 316
  • 522
5
votes
1 answer

Convert scikit-learn SVM model to LibSVM

I have trained a SVM (svc) using scikit-learn over half a terabyte of data. The model is working fine and I need to port it to C, but I don't want to re-train the SVM from scratch because it takes way too long for me. Is there a way to easily export…
Slartibartfast
  • 477
  • 1
  • 4
  • 13
5
votes
1 answer

LIBSVM overfitting

I trained two svms (LIBSVM) with 15451 samples after I did a 10-fold cross-validation and found the best parameter values for gamma and C (RBF kernel). In one svm I used just 1 feature and in the second an additional one (to see whether this…
5
votes
2 answers

One vs rest multiclass classification using LIBSVM. matlab

I am trying to implement one vs rest multiclass classification using LIBSVM. This link was useful http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/ovr_multiclass/ but i get an error in the function 'ovrpredict()'. The function is as below: function…
Sid
  • 249
  • 5
  • 16
5
votes
1 answer

Two functions with same name in Matlab

I am using libsvm in matlab and I am trying to call svmtrain. However I know that Matlab also has a built-in function called svmtrain. I believe they take the same parameters in different order. How do I know which function matlab is calling? I want…
user2604504
  • 697
  • 2
  • 14
  • 29
5
votes
1 answer

How to create training data for libsvm (as an svm_node struct)

I am trying to train an svm for a simple xor problem programmatically using libsvm to understand how the library works. The problem (i think) seems to be that i construct svm_node incorrectly; maybe i have trouble understanding the whole pointers to…
user3170496
5
votes
4 answers

How to use SVM in Weka?

I'm trying to use the svm classifier in weka. When I click on the libsvm classifier and try to train a model based on some provided training data, I get the error libsvm classes not in CLASSPATH. The weka website has some information on how to fix…
Shaayaan Sayed
  • 231
  • 2
  • 5
  • 13
5
votes
1 answer

How to train image (pixel) data in libsvm format to use for recognition with Java

I want to make a Java application to recognize characters by using libsvm but when get into this, I do not understand how could I train the image data to use with libsvm? Recently to learn it, I made a test with existing data: I have also create…
Osify
  • 2,253
  • 25
  • 42
5
votes
1 answer

How to calculate precision, recall and F-score with libSVM in python

I want to calculate the precision, recall and f-score using libsvm in Python but I do not know how. I have found this site but I have not understand how to call the function, if you can help me through example.
user2284345
  • 501
  • 2
  • 5
  • 9
5
votes
1 answer

Import trained SVM from scikit-learn to OpenCV

I'm porting an algorithm that uses a Support Vector Machine from Python (using scikit-learn) to C++ (using the machine learning library of OpenCV). I have access to the trained SVM in Python, and I can import SVM model parameters from an XML file…
Robert Hegner
  • 9,014
  • 7
  • 62
  • 98
5
votes
1 answer

Different accuracy for LibSVM and scikit-learn

For the same dataset and parameters I get different accuracy for LibSVM and scikit-learn's SVM implementation, even though scikit-learn also uses LibSVM internally. What did I overlook? LibSVM command line…
Framester
  • 33,341
  • 51
  • 130
  • 192
5
votes
2 answers

How to train in Matlab a model, save it to disk, and load in C++ program?

I am using libsvm version 3.16. I have done some training in Matlab, and created a model. Now I would like to save this model to disk and load this model in my C++ program. So far I have found the following alternatives: This answer explains how to…
Andrey Rubshtein
  • 20,795
  • 11
  • 69
  • 104
5
votes
3 answers

How to set up LIBSVM Matlab interface?

I am having problem with implementing LibSVM to MATLAB. I am using MATLAB R2009a (I also have the latest version, R2012b, but I dont use that one) I downloaded LibSVM package, libsvm-3.14 to my Windows 7 PC, which MATLAB and OCTAVE interface come…
ARAT
  • 884
  • 1
  • 14
  • 35
5
votes
1 answer

svm-train other parameter optimization

libsvm's "grid.py" try to optimize only two parameters "c" and "g" of svm-train. I wanted to extend "grid.py" to optimize for other parameters (for example "r" or "d") by running "grid.py" again and again for different parameters. I have some…
d.putto
  • 7,185
  • 11
  • 39
  • 45
4
votes
1 answer

Is there an efficient method to convert numpy.ndarray to list?

I have an array Y of the form(it is just an example, i have a huge data in this form). The array is formed by using numpy's vstack and hstack (i.e I don't want to change how I obtain this array as I have obtained it by some complex operations): …
Jannat Arora
  • 2,759
  • 8
  • 44
  • 70