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

How do I plot a classification graph of a SVM in R

I have an SVM in R and I would now like to plot the classification space for this machine. I have found some examples on the Internet, but I can't seem to make sense of them. My R script is as follows: library(e1071) day_of_week <-…
Spacen Jasset
  • 938
  • 2
  • 11
  • 21
12
votes
2 answers

Support Vector Machine library for C#

Is there any Support Vector Machine library already implemented which I could use in my C# projects?
Simon
  • 4,999
  • 21
  • 69
  • 97
11
votes
1 answer

Multi-class classification in libsvm

I'm working with libsvm and I must implement the classification for multiclasses with one versus all. How can I do it? Does libsvm version 2011 use this? I think that my question is not very clear. if libsvm don't use automatically one versus…
images
  • 171
  • 1
  • 1
  • 6
11
votes
3 answers

Multi-Class SVM( one versus all)

I know that LIBSVM only allows one-vs-one classification when it comes to multi-class SVM. However, I would like to tweak it a bit to perform one-against-all classification. I have tried to perform one-against-all below. Is this the correct…
lakshmen
  • 28,346
  • 66
  • 178
  • 276
11
votes
2 answers

support vector machines in matlab

Could you give an example of classification of 4 classes using Support Vector Machines (SVM) in matlab something like: atribute_1 atribute_2 atribute_3 atribute_4 class 1 2 3 4 0 1 2 3 …
edgarmtze
  • 24,683
  • 80
  • 235
  • 386
11
votes
3 answers

Predict probabilities using SVM

I wrote this code and wanted to obtain probabilities of classification. from sklearn import svm X = [[0, 0], [10, 10],[20,30],[30,30],[40, 30], [80,60], [80,50]] y = [0, 1, 2, 3, 4, 5, 6] clf = svm.SVC() clf.probability=True clf.fit(X, y) prob =…
Vidya Marathe
  • 403
  • 2
  • 6
  • 17
11
votes
3 answers

Warning messages when using python

I keep getting this when I run SVM python code: Warning (from warnings module): File "/usr/local/lib/python2.7/dist-packages/sklearn/cross_validation.py", line 44 "This module will be removed in 0.20.", DeprecationWarning) DeprecationWarning:…
Dhara
  • 282
  • 1
  • 4
  • 19
11
votes
3 answers

Opencv 3 SVM training

As you may know, many things changed in OpenCV 3 (in comparision to the openCV2 or the old first version). In the old days, to train SVM one would use: CvSVMParams params; params.svm_type = CvSVM::C_SVC; params.kernel_type =…
Jack L.
  • 1,257
  • 2
  • 17
  • 37
11
votes
2 answers

How to perform multi-class classification using 'svm' of e1071 package in R

I want to perform multi-class classification using the svm function of e1071 package. But from what I came to know from the documentation of svm, it can only perform binary classification. The vignettes document tells this for multi-class…
StrikeR
  • 1,598
  • 5
  • 18
  • 35
11
votes
1 answer

Combining Grid search and cross validation in scikit learn

For improving Support Vector Machine outcomes i have to use grid search for searching better parameters and cross validation. I'm not sure how combining them in scikit-learn. Grid search search best parameters…
postgres
  • 2,242
  • 5
  • 34
  • 50
11
votes
2 answers

10 fold cross-validation in one-against-all SVM (using LibSVM)

I want to do a 10-fold cross-validation in my one-against-all support vector machine classification in MATLAB. I tried to somehow mix these two related answers: Multi-class classification in libsvm Example of 10-fold SVM classification in…
Zahra E
  • 427
  • 1
  • 6
  • 25
11
votes
1 answer

Prepare data for text classification using Scikit Learn SVM

I'm trying to apply SVM from Scikit learn to classify the tweets I collected. So, there will be two categories, name them A and B. For now, I have all the tweets categorized in two text file, 'A.txt' and 'B.txt'. However, I'm not sure what type of…
user1906856
  • 141
  • 2
  • 2
  • 4
11
votes
1 answer

SVM versus MLP (Neural Network): compared by performance and prediction accuracy

I should decide between SVM and neural networks for some image processing application. The classifier must be fast enough for near-real-time application and accuracy is important too. Since this is a medical application, it is important that the…
Lily
  • 315
  • 2
  • 6
  • 16
10
votes
1 answer

Why is cross_val_predict not appropriate for measuring the generalisation error?

When I train a SVC with cross validation, y_pred = cross_val_predict(svc, X, y, cv=5, method='predict') cross_val_predict returns one class prediction for each element in X, so that y_pred.shape = (1000,) when m=1000. This makes sense, since cv=5…
zwithouta
  • 1,319
  • 1
  • 9
  • 22
10
votes
1 answer

Kernel in a logistic regression model LogisticRegression scikit-learn sklearn

How can I use a kernel in a logistic regression model using the sklearn library? logreg = LogisticRegression() logreg.fit(X_train, y_train) y_pred =…
Rubiks
  • 461
  • 1
  • 6
  • 21