Questions tagged [svm]

Support vector machines (SVMs) are a set of related supervised learning methods that analyze data and recognize patterns, used for classification and regression analysis.

From Wikipedia:

Support vector machines (SVMs) are a set of related supervised learning methods that analyze data and recognize patterns, used for classification and regression analysis. The standard SVM takes a set of input data and predicts, for each given input, which of two possible classes the input is a member of, which makes the SVM a non-probabilistic binary linear classifier. Since an SVM is a classifier, then given a set of training examples, each marked as belonging to one of two categories, an SVM training algorithm builds a model that assigns new examples into one category or the other. Intuitively, an SVM model is a representation of the examples as points in space, mapped so that the examples of the separate categories are divided by a clear gap that is as wide as possible. New examples are then mapped into that same space and predicted to belong to a category based on which side of the gap they fall on.

4561 questions
9
votes
5 answers

ValueError while using linear SVM of scikit-learn python

I am currently working on large scale hierarchical text classification of ODP documents. The dataset provided to me is in the libSVM format. I am trying to run the linear kernel SVM of python's scikit-learn to develop the model. Below is the sample…
user3377770
  • 91
  • 1
  • 1
  • 4
9
votes
1 answer

OpenCV templates in 2D point data set

I was wandering what the best approach would be for detecting 'figures' in an array of 2D points. In this example I have two 'templates'. Figure 1 is a template and figure 2 is a template. Each of these templates exists only as a vector of points…
Wim Vanhenden
  • 841
  • 2
  • 12
  • 18
9
votes
2 answers

[scikit learn]: Anomaly Detection - Alternative for OneClassSVM

I have implemented LinearSVC and SVC from the sklearn-framework for text classification. I am using TfidfVectorizer to get sparse representation of the input data that consists of two different classes(benign data and malicious data). This part is…
Milchbart
  • 91
  • 1
  • 2
9
votes
1 answer

libsvm (C++) Always Outputting Same Prediction

I have implemented an OpenCV/C++ wrapper for libsvm. When doing a grid-search for SVM parameters (RBF kernel), the prediction always returns the same label. I have created artificial data sets which have very easily separable data (and tried…
trianta2
  • 3,952
  • 5
  • 36
  • 52
9
votes
3 answers

OPencv SVM predict probability

I am developing a image-classification project using BOW model and SVM. I want to find out the SVMs predict probability but there is no such function in opencv svm. Is there any way to do this? I want to find out the predict probability in n-class…
9
votes
7 answers

How to Setup LIBSVM for Python

I built libsvm on Mac OS X with Make. $ tar xzfv libsvm-3.17.tar.gz $ cd libsvm-3.17 $ make This built the various libsvm binaries: $ ls COPYRIGHT heart_scale svm-predict.c svm-train.c tools FAQ.html java svm-scale …
David Williams
  • 8,388
  • 23
  • 83
  • 171
9
votes
2 answers

How to run libsvm in MATLAB?

How to get started with libsvm under MATLAB? I've downloaded the library, and extracted it in C:\Program Files\MATLAB\R2012a\toolbox\, but then I don't know how to use it in MATLAB.
user2157806
  • 319
  • 2
  • 8
  • 17
9
votes
1 answer

Advantages of SVM over decion trees and AdaBoost algorithm

I am working on binary classification of data and I want to know the advantages and disadvantages of using Support vector machine over decision trees and Adaptive Boosting algorithms.
8
votes
2 answers

Build a custom svm kernel matrix with opencv

I have to train a Support Vector Machine model and I'd like to use a custom kernel matrix, instead of the preset ones (like RBF, Poly, ecc.). How can I do that (if is it possible) with opencv's machine learning library? Thank you!
Carlo Pane
  • 193
  • 2
  • 12
8
votes
1 answer

How to extract info from scikits.learn classifier to then use in C code

I have trained a bunch of RBF SVMs using scikits.learn in Python and then Pickled the results. These are for image processing tasks and one thing I want to do for testing is run each classifier on every pixel of some test images. That is, extract…
ely
  • 74,674
  • 34
  • 147
  • 228
8
votes
1 answer

One Class SVM algorithm taking too long

The data bellow shows part of my dataset, that is used to detect anomalies describe_file data_numbers index 0 gkivdotqvj 7309.0 0 1 hpwgzodlky 2731.0 1 2 dgaecubawx 0.0 2 3 NaN …
E199504
  • 425
  • 4
  • 12
8
votes
2 answers

At least one label specified must be in y_true, target vector is numerical

I am implementing an SVM project with this data here is how I extract the features: import itertools import matplotlib.pyplot as plt import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from sklearn import…
user5871360
8
votes
4 answers

Datasets to test Nonlinear SVM

I'm implementing a nonlinear SVM and I want to test my implementation on a simple not linearly separable data. Google didn't help me find what I want. Can you please advise me where I can find such data. Or at least, how can I generate such data…
Morano88
  • 2,047
  • 4
  • 25
  • 44
8
votes
1 answer

Support Vector Regression multiple outputs

I am currently testing Support Vector Regression (SVR) for a regression problem with two outputs. This means that Y_train_data has two values for each sample. Since SVR can only produce a single output, I use the MultiOutputRegressor from…
MerklT
  • 803
  • 7
  • 18
8
votes
1 answer

Speed of SVM Kernels? Linear vs RBF vs Poly

I'm using scikitlearn in Python to create some SVM models while trying different kernels. The code is pretty simple, and follows the form of: from sklearn import svm clf = svm.SVC(kernel='rbf', C=1, gamma=0.1) clf = svm.SVC(kernel='linear', C=1,…
Nicholas Hassan
  • 949
  • 2
  • 10
  • 27