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

How to apply standardization to SVMs in scikit-learn?

I'm using the current stable version 0.13 of scikit-learn. I'm applying a linear support vector classifier to some data using the class sklearn.svm.LinearSVC. In the chapter about preprocessing in scikit-learn's documentation, I've read the…
pemistahl
  • 9,304
  • 8
  • 45
  • 75
25
votes
1 answer

Scikit-learn grid search with SVM regression

I am learning cross validation-grid search and came across this youtube playlist and the tutorial also has been uploaded to the github as an ipython notebook. I am trying to recreate the codes in the Searching multiple parameters simultaneously…
Eka
  • 14,170
  • 38
  • 128
  • 212
25
votes
0 answers

Full example of multiple-class SVM with cross-validation using Matlab

I am currently confusing about implementing SVM with cross-validation using Matlab now. There are many post on stackoverflow that mentioned pieces of information about SVM and its cross-validation; however, there is no full example even using the…
Samo Jerom
  • 2,361
  • 7
  • 32
  • 38
24
votes
2 answers

How to Interpret Predict Result of SVM in R?

I'm new to R and I'm using the e1071 package for SVM classification in R. I used the following code: data <- loadNumerical() model <- svm(data[,-ncol(data)], data[,ncol(data)], gamma=10) print(predict(model, data[c(1:20),-ncol(data)])) The…
Derrick Zhang
  • 21,201
  • 18
  • 53
  • 73
23
votes
2 answers

What is a good range of values for the svm.SVC() hyperparameters to be explored via GridSearchCV()?

I am running into the problem that the hyperparameters of my svm.SVC() are too wide such that the GridSearchCV() never gets completed! One idea is to use RandomizedSearchCV() instead. But again, my dataset is relative big such that 500 iterations…
user706838
  • 5,132
  • 14
  • 54
  • 78
22
votes
1 answer

using precomputed kernels with libsvm

I'm currently working on classifying images with different image-descriptors. Since they have their own metrics, I am using precomputed kernels. So given these NxN kernel-matrices (for a total of N images) i want to train and test a SVM. I'm not…
Henrik
  • 582
  • 1
  • 3
  • 15
22
votes
1 answer

Under what parameters are SVC and LinearSVC in scikit-learn equivalent?

I read this thread about the difference between SVC() and LinearSVC() in scikit-learn. Now I have a data set of binary classification problem(For such a problem, the one-to-one/one-to-rest strategy difference between both functions could be…
Sidney
  • 321
  • 1
  • 2
  • 13
22
votes
1 answer

Example of 10-fold SVM classification in MATLAB

I need a somehow descriptive example showing how to do a 10-fold SVM classification on a two class set of data. there is just one example in the MATLAB documentation but it is not with 10-fold. Can someone help me?
Hossein
  • 40,161
  • 57
  • 141
  • 175
22
votes
2 answers

How to obtain features' weights

I am dealing with highly imbalanced data set and my idea is to obtain values of feature weights from my libSVM model. As for now I am OK with the linear kernel, where I can obtain feature weights, but when I am using rbf or poly, I fail to reach my…
Paul85
  • 647
  • 1
  • 11
  • 27
22
votes
3 answers

Non-Integer Class Labels Scikit-Learn

Quick SVM question for scikit-learn. When you train an SVM, it's something like from sklearn import svm s = svm.SVC() s.fit(training_data, labels) Is there any way for labels to be a list of a non-numeric type? For instance, if I want to classify…
follyroof
  • 3,430
  • 2
  • 28
  • 26
22
votes
3 answers

SVM classifier based on HOG features for "object detection" in OpenCV

I have a project, which I want to detect objects in the images; my aim is to use HOG features. By using OpenCV SVM implementation , I could find the code for detecting people, and I read some papers about tuning the parameters in order to detect…
Mario
  • 1,469
  • 7
  • 29
  • 46
21
votes
5 answers

Designing a Kernel for a support vector machine (XOR)

The meat of my question is "how does one design a kernel function for a learning problem?" As a quick background, I'm reading books on support vector machines and kernel machines, and everywhere I look authors give examples of kernels (polynomial…
JeremyKun
  • 2,987
  • 2
  • 24
  • 44
21
votes
2 answers

Scikit classification report - change the format of displayed results

Scikit classification report would show precision and recall scores with two digits only. Is it possible to make it display 4 digits after the dot, I mean instead of 0.67 to show 0.6783? from sklearn.metrics import classification_report print…
Crista23
  • 3,203
  • 9
  • 47
  • 60
21
votes
4 answers

SVM - what is a functional margin?

A geometric margin is simply the euclidean distance between a certain x (data point) to the hyperlane. What is the intuitive explanation to what a functional margin is? Note: I realize that a similar question has been asked here: How to understand…
Cheshie
  • 2,777
  • 6
  • 32
  • 51
21
votes
6 answers

Getting an error "(subscript) logical subscript too long" while training SVM from e1071 package in R

I am training svm using my traindata. (e1071 package in R). Following is the information about my data. > str(train) 'data.frame': 891 obs. of 10 variables: $ survived: int 0 1 1 1 0 0 0 0 1 1 ... $ pclass : int 3 1 3 1 3 3 1 3 3 2 ... $ name …
Ayush Raj Singh
  • 863
  • 5
  • 16
  • 20