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

What's the relationship between an SVM and hinge loss?

My colleague and I are trying to wrap our heads around the difference between logistic regression and an SVM. Clearly they are optimizing different objective functions. Is an SVM as simple as saying it's a discriminative classifier that simply…
Simon
  • 2,840
  • 2
  • 18
  • 26
7
votes
1 answer

Why is the scikit-learn SVM classifier running so long while using so little CPU?

I am executing the scikit-learn SVM classifier (SVC) from python 2.7.10 and it has been running for over 2 hours now. I have read the data using pandas.read_csv preprocessed it and then run clf = SVC(C = 0.001, kernel = 'linear', cache_size = 7000,…
7
votes
1 answer

Can I explicitly set the list of possible classes for an sklearn SVM?

I have a program that uses the SVC class from sklearn. Really, I'm using the OneVsRestClassifier class which uses the SVC class. My problem is that the predict_proba() method sometimes returns an vector that's too short. This is because the classes_…
Josh Kelle
  • 71
  • 1
  • 4
7
votes
5 answers

High volume SVM (machine learning) system

I working on a possible machine learning project that would be expected to do high speed computations for machine learning using SVM (support vector machines) and possibly some ANN. I'm resonably comfortable working on matlab with these, but…
malangi
  • 2,692
  • 4
  • 28
  • 42
7
votes
1 answer

Error in plotting SVM classification graph

I'm using the support vector machine from the e1071 package to classify my data and want to visualize how the machine actually does the classification. However, when using the plot.svm function, I get an error that I can't…
user655423
  • 115
  • 1
  • 5
7
votes
2 answers

sklearn and SVMs with polynomial kernel

I am using sklearn for python to perform cross validation using SVMs. I tried with the linear and rbf kernels and it all works fine. When i run it with the polynomial kernel though it never finishes. It has been running for 8 hours and still…
user1663930
  • 295
  • 2
  • 5
  • 12
7
votes
1 answer

SVM parameter optimization in Opencv

I want to optimize SVM parameters in Opencv. But, every time I use train_auto I get C=1 and gamma=1. Some people use LibSVM but I could not write a wrapper for that. Both trainingData and labels are taken from an existing code which gives good…
garnettburak
  • 143
  • 1
  • 9
7
votes
1 answer

Plot margins for support vector machine

i just set up a SVM in R with e1071. Unfortunately the plot of the margin and die hyperplane does not look as desired. I wanted the margin to pass through the support vectors. Shouldnt this be the case? Can anybody spot my mistake? Here is my…
user3008056
7
votes
1 answer

Feature Selection in caret rfe + sum with ROC

I have been trying to apply recursive feature selection using caret package. What I need is that ref uses the AUC as performance measure. After googling for a month I cannot get the process working. Here is the code I have…
José Palma
  • 71
  • 1
  • 3
7
votes
2 answers

Normalizing feature values for SVM

I've been playing with some SVM implementations and I am wondering - what is the best way to normalize feature values to fit into one range? (from 0 to 1) Let's suppose I have 3 features with values in ranges of: 3 - 5. 0.02 - 0.05 10-15. How do I…
user3010273
  • 890
  • 5
  • 11
  • 18
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

Help using predict() for kernlab's SVM in R?

I am trying to use the kernlab R package to do Support Vector Machines (SVM). For my very simple example, I have two pieces of training data. A and B. (A and B are of type matrix - they are adjacency matrices for graphs.) So I wrote a function which…
poundifdef
  • 18,726
  • 23
  • 95
  • 134
7
votes
1 answer

How to customize a kernel function in ksvm of kernlab package?

I have latitudes and longitudes, so I need to redefine the RBF kernel into exp(-1/2||sophere distrance||^2), which means I need to rewrite a kernel function myself. I write my kernel as follows: round.kernel <- function(x,y){ sigma <- 1 #R <-…
Yitong Zhou
  • 1,155
  • 4
  • 22
  • 42
7
votes
2 answers

How to choose the right kernel functions

I have a very general question: how do I choose the right kernel function for SVM? I know the ultimate answer is try all the kernels, do out-of-sample validation, and pick the one with best classification result. But other than that, is there any…
CuriousMind
  • 15,168
  • 20
  • 82
  • 120