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
7
votes
1 answer

Is libsvm accurate?

With StompChicken's corrections (I miscomputed one dot product, ugh!) the answer appears to be yes. I have since tested the same problem using a precomputed kernel with the same correct results. If you are using libsvm StompChickens clear, organized…
user334911
7
votes
1 answer

Why can't LinearSVC do this simple classification?

I'm trying to do the following simple classification using the LinearSVC object in scikit-learn. I've tried using both version 0.10 and 0.14. Using the code: from sklearn.svm import LinearSVC, SVC from numpy import * data = array([[ 1007., …
Isaac
  • 3,586
  • 1
  • 18
  • 20
7
votes
3 answers

Support Vector Machine vs K Nearest Neighbours

I have a data set to classify.By using KNN algo i am getting an accuracy of 90% but whereas by using SVM i just able to get over 70%. Is SVM not better than KNN. I know this might be stupid to ask but, what are the parameters for SVM which will give…
Mohit Jain
  • 733
  • 3
  • 9
  • 24
7
votes
3 answers

data imbalance in SVM using libSVM

How should I set my gamma and Cost parameters in libSVM when I am using an imbalanced dataset that consists of 75% 'true' labels and 25% 'false' labels? I'm getting a constant error of having all the predicted labels set on 'True' due to the data…
Arturo
  • 3,679
  • 6
  • 34
  • 43
7
votes
3 answers

facial expression classification in real time using SVM

I am currently working on a project where I have to extract the facial expression of a user (only one user at a time from a webcam) like sad or happy. My method for classifying facial expressions is: Use opencv to detect the face in the image Use…
TIBOU
  • 337
  • 2
  • 6
  • 16
7
votes
4 answers

Using LIBSVM grid.py for unbalanced data?

I'm having a three class problem with unbalanced data (90%, 5%, 5%). Now I want to train a classifier using LIBSVM. The problem is that LIBSVM optimizes its parameter gamma and Cost for optimal accuracy, which means that 100% of the examples are…
Damnum
  • 1,839
  • 16
  • 35
6
votes
2 answers

bad result when using precomputed chi2 kernel with libsvm (matlab)

I am trying libsvm and I follow the example for training a svm on the heart_scale data which comes with the software. I want to use a chi2 kernel which I precompute myself. The classification rate on the training data drops to 24%. I am sure I…
Sallos
  • 61
  • 1
  • 6
6
votes
2 answers

sklearn: AUC score for LinearSVC and OneSVM

One option of the SVM classifier (SVC) is probability which is false by default. The documentation does not say what it does. Looking at libsvm source code, it seems to do some sort of cross-validation. This option does not exist for LinearSVC nor…
Ricardo Magalhães Cruz
  • 3,504
  • 6
  • 33
  • 57
6
votes
2 answers

How to convert a map to Spark's RDD

I have a data set which is in the form of some nested maps, and its Scala type is: Map[String, (LabelType,Map[Int, Double])] The first String key is a unique identifier for each sample, and the value is a tuple that contains the label (which is -1…
Alt
  • 2,597
  • 5
  • 26
  • 36
6
votes
2 answers

Calculating Nearest Match to Mean/Stddev Pair With LibSVM

I'm new to SVMs, and I'm trying to use the Python interface to libsvm to classify a sample containing a mean and stddev. However, I'm getting nonsensical results. Is this task inappropriate for SVMs or is there an error in my use of libsvm? Below is…
Cerin
  • 60,957
  • 96
  • 316
  • 522
6
votes
2 answers

Converting CSV file to LIBSVM compatible data file using python

I am doing a project using libsvm and I am preparing my data to use the lib. How can I convert CSV file to LIBSVM compatible data? CSV File: https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/datasets/data/iris.csv In the…
user3378649
  • 5,154
  • 14
  • 52
  • 76
6
votes
2 answers

SVM - relation between the number of training samples and the number of features

What should be the relation between the number of training samples and the dimensionality of the training data? For example, I am having a case with 20000 training samples with 16000 features. I am considering the case of using PCA to obtain some…
Simon
  • 4,999
  • 21
  • 69
  • 97
6
votes
2 answers

Weka error "cannot handle numeric class" in Java code using LibSVM

I'm trying to use a classifier LibSVM-based using Weka, but i got this error: Exception in thread "main" weka.core.UnsupportedAttributeTypeException:weka.classifiers.functions.LibSVM: Cannot handle numeric class! at…
accand
  • 531
  • 1
  • 8
  • 17
6
votes
1 answer

How to find the Precision, Recall, Accuracy using SVM?

Duplicate calculating Precision, Recall and F Score I have a input file with text description and classified level (i.e.levelA and levelB). I want to write a SVM classifier that measure precision, recall and accuracy. I looked at scikit and LIBSVM…
user2326956
6
votes
2 answers

problems after addpath libsvm library in matlab

i want to know how libsvm works. I tried this code in this link [1]: 10 fold cross-validation in one-against-all SVM (using LibSVM) . It's working (I havent added path libsvm library in matlab) but after i add libsvm library. it is not working. I…
user2157806
  • 319
  • 2
  • 8
  • 17