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
18
votes
5 answers

Implementing a linear, binary SVM (support vector machine)

I want to implement a simple SVM classifier, in the case of high-dimensional binary data (text), for which I think a simple linear SVM is best. The reason for implementing it myself is basically that I want to learn how it works, so using a library…
static_rtti
  • 53,760
  • 47
  • 136
  • 192
18
votes
1 answer

libsvm Shrinking Heuristics

I'm using libsvm in C-SVC mode with a polynomial kernel of degree 2 and I'm required to train multiple SVMs. During training, I am getting either one or even both of these warnings for some of the SVMs that I train: WARNING: using -h 0 may be…
Mihai Todor
  • 8,014
  • 9
  • 49
  • 86
17
votes
2 answers

Plot scikit-learn (sklearn) SVM decision boundary / surface

I am currently performing multi class SVM with linear kernel using python's scikit library. The sample training data and testing data are as given below: Model data: x =…
Yoganand.N
  • 907
  • 1
  • 10
  • 24
17
votes
2 answers

What is the difference between LinearSVC and SVC(kernel="linear")?

I found sklearn.svm.LinearSVC and sklearn.svm.SVC(kernel='linear') and they seem very similar to me, but I get very different results on Reuters. sklearn.svm.LinearSVC: 81.05% in 28.87s train / 9.71s test sklearn.svm.SVC : 33.55% in…
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
17
votes
1 answer

What is the difference between OneVsRestClassifier with SVC and SVC with decision_function_shape='ovr'?

I thought it should be the same, but for method decision_function() I get different results. And SVC with only decision_function_shape='ovr' is really faster. Related: Scikit learn multi-class classification for support vector machines
MBrzeski
  • 171
  • 4
17
votes
1 answer

How to present multiple time-series data to an SVM (ksvm) in R (or, How to present two-dimensional input data to an SVM)

How can I make a ksvm model aware that the first 100 numbers in a dataset are all time series data from one sensor, while the next 100 numbers are all time series data from another sensor, etc, for six separate time series sensor inputs?…
phonetagger
  • 7,701
  • 3
  • 31
  • 55
17
votes
1 answer

SVM with cross validation in R using caret

I was told to use the caret package in order to perform Support Vector Machine regression with 10 fold cross validation on a data set I have. I'm plotting my response variable against 151 variables. I did the following:- > ctrl <-…
user2062207
  • 955
  • 4
  • 18
  • 34
17
votes
1 answer

Matlab libsvm - how to find the w coefficients

How can find what the vector w is, i.e. the perpendicular to the separation plane?
Trup
  • 1,635
  • 13
  • 27
  • 40
16
votes
1 answer

How to standardize data with sklearn's cross_val_score()

Let's say I want to use a LinearSVC to perform k-fold-cross-validation on a dataset. How would I perform standardization on the data? The best practice I have read is to build your standardization model on your training data then apply this model to…
als5ev
  • 175
  • 1
  • 5
16
votes
2 answers

Can an SVM learn incrementally?

I am using a multi-dimensional SVM classifier (SVM.NET, a wrapper for libSVM) to classify a set of features. Given an SVM model, is it possible to incorporate new training data without having to recalculate on all previous data? I guess another way…
Petrus Theron
  • 27,855
  • 36
  • 153
  • 287
16
votes
1 answer

R understanding {caret} train(tuneLength = ) and SVM methods from {kernlab}

Trying to better understand how train(tuneLength = ) works in {caret}. My confusion happened when trying to understand some of the differences between the SVM methods from {kernlab} I've reviewed the documentation (here) and the caret training page…
J.M.
  • 257
  • 1
  • 2
  • 13
16
votes
1 answer

Does the dataset size influence a machine learning algorithm?

So, imagine having access to sufficient data (millions of datapoints for training and testing) of sufficient quality. Please ignore concept drift for now and assume the data static and does not change over time. Does it even make sense to use all of…
user3354890
  • 367
  • 1
  • 3
  • 10
16
votes
1 answer

How much time does take train SVM classifier?

I wrote following code and test it on small data: classif = OneVsRestClassifier(svm.SVC(kernel='rbf')) classif.fit(X, y) Where X, y (X - 30000x784 matrix, y - 30000x1) are numpy arrays. On small data algorithm works well and give me right…
Il'ya Zhenin
  • 1,272
  • 2
  • 20
  • 31
16
votes
2 answers

Training complexity of Linear SVM

Which is the actual computational complexity of the learning phase of SVM (let's say, that implemented in LibSVM)? Thank you
user1923631
  • 383
  • 2
  • 5
  • 15
16
votes
3 answers

svm scaling input values

I am using libSVM. Say my feature values are in the following format: instance1 : f11, f12, f13, f14 instance2 : f21, f22, f23, f24 instance3 : f31, f32, f33, f34 …
user570593
  • 3,420
  • 12
  • 56
  • 91