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
10
votes
3 answers

How to plot SVM decision boundary in sklearn Python?

Using SVM with sklearn library, I would like to plot the data with each labels representing its color. I don't want to color the points but filling area with colors. I have now : d_pred, d_train_std, d_test_std, l_train, l_test d_pred are the…
anthonya
  • 565
  • 2
  • 6
  • 15
10
votes
1 answer

line search fails when training a model using caret

I am using the train function in caret to train a SVM using the svmRadial kernel for a binary classification task I have. When I run the train function on my data, I incrementally get these messages which say line search fails -2.13865 -0.1759025…
TheGoat
  • 2,587
  • 3
  • 25
  • 58
10
votes
3 answers

Python: convert matrix to positive semi-definite

I'm currently working on kernel methods, and at some point I needed to make a non positive semi-definite matrix (i.e. similarity matrix) into one PSD matrix. I tried this approach: def makePSD(mat): #make symmetric k = (mat+mat.T)/2 …
user1231818
  • 158
  • 1
  • 1
  • 5
10
votes
2 answers

ValueError: The number of classes has to be greater than one (python)

When passing x,y in fit, I am getting the following error: Traceback (most recent call last): File "C:/Classify/classifier.py", line 95, in train_avg, test_avg, cms = train_model(X, y, "ceps", plot=True) File "C:/Classify/classifier.py", line…
VKS
  • 487
  • 2
  • 7
  • 21
10
votes
2 answers

Plotting 3D Decision Boundary From Linear SVM

I've fit a 3 feature data set using sklearn.svm.svc(). I can plot the point for each observation using matplotlib and Axes3D. I want to plot the decision boundary to see the fit. I've tried adapting the 2D examples for plotting the decision boundary…
pioneer903
  • 171
  • 1
  • 1
  • 12
10
votes
2 answers

SKLearn how to get decision probabilities for LinearSVC classifier

I am using scikit-learn's linearSVC classifier for text mining. I have the y value as a label 0/1 and the X value as the TfidfVectorizer of the text document. I use a pipeline like below pipeline = Pipeline([ ('count_vectorizer', …
Sakib
  • 1,503
  • 4
  • 26
  • 39
10
votes
1 answer

How to discover new classes in a classification machine learning algorithm?

I'm using a multiclass classifier (a Support Vector Machine, via One-Vs-All) to classify data samples. Let's say I currently have n distinct classes. However, in the scenario I'm facing, it is possible that a new data sample may belong to a new…
Oliver
  • 279
  • 2
  • 8
10
votes
1 answer

Support Vector Machine kernel types

Popular kernel functions used in Support Vector Machines are Linear, Radial Basis Function and Polynomial. Can someone please expalin what this kernel function is in simple way :) As I am new to this area I don't clear understand what is the…
user5232014
10
votes
1 answer

Scaling of target causes Scikit-learn SVM regression to break down

When training a SVM regression it is usually advisable to scale the input features before training. But how about scaling of the targets? Usually this is not considered necessary, and I do not see a good reason why it should be necessary. However in…
user1774143
  • 192
  • 1
  • 7
10
votes
2 answers

How to fix the false positives rate of a linear SVM?

I am an SVM newbie and this is my use case: I have a lot of unbalanced data to be binary classified using a linear SVM. I need to fix the false positives rate at certain values and measure the corresponding false negatives for each value. I am using…
Rabih Kodeih
  • 9,361
  • 11
  • 47
  • 55
10
votes
4 answers

Best MATLAB toolbox that implements Support Vector Regression?

In this Wikipedia article about SVM there are a number of links to different implementations of MATLAB toolboxes for Support Vector Machines. Could anyone suggest which of these is best in terms of speed, ease of use, etc.?
Degvik
  • 3,050
  • 6
  • 25
  • 20
10
votes
5 answers

Any python Support Vector Machine library around that allows online learning?

I do know there are some libraries that allow to use Support vector Machines from python code, but I am looking specifically for libraries that allow one to teach it online (this is, without having to give it all the data at once). Are there any?
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
9
votes
4 answers

selecting c and gamma value

Hi I am performing SVM classification using SMO, in which my kernel is RBF, now I want to select c and sigma values, using grid search and cross validation, I am new to kernel functions, please help, in step by step process
pradeep deep
  • 99
  • 1
  • 1
  • 2
9
votes
1 answer

How to use libsvm in Matlab?

I am new to matlab and don't know how to use libsvm. Is there any sample code for classifying some data (with 2 features) with a SVM and then visualize the result? How about with kernel (RBF, Polynomial, and Sigmoid )? I saw that readme file in…
Sina
  • 1,632
  • 3
  • 15
  • 21
9
votes
2 answers

How to run easy.py of libsvm in window?

I am new to the libsvm and sorry for some silly questions. I am trying to run easy.py but have problems to do so. I have downloaded the libsvm-3.1 package and extract it into C:\User\Cassie\libsvm Install Python and it created a folder at…
Cassie
  • 1,179
  • 6
  • 18
  • 30