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

When should one use LinearSVC or SVC?

From my research, I found three conflicting results: SVC(kernel="linear") is better LinearSVC is better Doesn't matter Can someone explain when to use LinearSVC vs. SVC(kernel="linear")? It seems like LinearSVC is marginally better than SVC and is…
THIS USER NEEDS HELP
  • 3,136
  • 4
  • 30
  • 55
42
votes
7 answers

Why feature scaling in SVM?

I found that scaling in SVM (Support Vector Machine) problems really improve its performance. I have read this explanation: The main advantage of scaling is to avoid attributes in greater numeric ranges dominating those in smaller numeric…
Kevin
  • 569
  • 1
  • 5
  • 12
39
votes
4 answers

Is F1 micro the same as Accuracy?

I have tried many examples with F1 micro and Accuracy in scikit-learn and in all of them, I see that F1 micro is the same as Accuracy. Is this always true? Script from sklearn import svm from sklearn import metrics from sklearn.cross_validation…
Just life
  • 585
  • 1
  • 4
  • 10
37
votes
7 answers

SVM and Neural Network

What is difference between SVM and Neural Network? Is it true that linear svm is same NN, and for non-linear separable problems, NN uses adding hidden layers and SVM uses changing space dimensions?
CoyBit
  • 1,592
  • 1
  • 17
  • 19
35
votes
3 answers

How to interpret scikit's learn confusion matrix and classification report?

I have a sentiment analysis task, for this Im using this corpus the opinions have 5 classes (very neg, neg, neu, pos, very pos), from 1 to 5. So I do the classification as follows: from sklearn.feature_extraction.text import TfidfVectorizer import…
john doe
  • 2,233
  • 7
  • 37
  • 58
34
votes
10 answers

Fastest SVM implementation usable in Python

I'm building some predictive models in Python and have been using scikits learn's SVM implementation. It's been really great, easy to use, and relatively fast. Unfortunately, I'm beginning to become constrained by my runtime. I run a rbf SVM on a…
tomas
  • 665
  • 1
  • 10
  • 14
34
votes
5 answers

When should I use support vector machines as opposed to artificial neural networks?

I know SVMs are supposedly 'ANN killers' in that they automatically select representation complexity and find a global optimum (see here for some SVM praising quotes). But here is where I'm unclear -- do all of these claims of superiority hold for…
zergylord
  • 4,368
  • 5
  • 38
  • 60
33
votes
6 answers

Which machine learning library to use

I am looking for a library that, ideally, has the following features: implements hierarchical clustering of multidimensional data (ideally on similiarity or distance matrix) implements support vector machines is in C++ is somewhat documented (this…
Björn Pollex
  • 75,346
  • 28
  • 201
  • 283
31
votes
3 answers

ValueError: setting an array element with a sequence. while using SVM in scikit-learn

I have been working on scikit-learn SVMs for a binary classification problem. I have calculated the features of audio files and wrote them into a CSV file. This is how each row in a CSV file looks like: "13_10 The Long And Winding Road "…
Nikki_Champ
  • 1,047
  • 1
  • 9
  • 13
31
votes
5 answers

How can i know probability of class predicted by predict() function in Support Vector Machine?

How can i know sample's probability that it belongs to a class predicted by predict() function of Scikit-Learn in Support Vector Machine? >>>print clf.predict([fv]) [5] There is any function?
postgres
  • 2,242
  • 5
  • 34
  • 50
30
votes
3 answers

What's the difference between LibSVM and LibLinear

libsvm and liblinear are both software libraries that implement Support Vector Machines. What's the difference? And how do the differences make liblinear faster than libsvm?
ukessi
  • 1,381
  • 1
  • 10
  • 15
28
votes
4 answers

A few implementation details for a Support-Vector Machine (SVM)

In a particular application I was in need of machine learning (I know the things I studied in my undergraduate course). I used Support Vector Machines and got the problem solved. Its working fine. Now I need to improve the system. Problems here…
claws
  • 52,236
  • 58
  • 146
  • 195
28
votes
2 answers

Choosing from different cost function and activation function of a neural network

Recently I started toying with neural networks. I was trying to implement an AND gate with Tensorflow. I am having trouble understanding when to use different cost and activation functions. This is a basic neural network with only input and output…
Shubhashis
  • 10,411
  • 11
  • 33
  • 48
28
votes
4 answers

How to generate a custom cross-validation generator in scikit-learn?

I have an unbalanced dataset, so I have an strategy for oversampling that I only apply during training of my data. I'd like to use classes of scikit-learn like GridSearchCV or cross_val_score to explore or cross validate some parameters on my…
ssierral
  • 8,537
  • 6
  • 26
  • 44
26
votes
8 answers

An example using python bindings for SVM library, LIBSVM

I am in dire need of a classification task example using LibSVM in python. I don't know how the Input should look like and which function is responsible for training and which one for testing Thanks
Hossein
  • 40,161
  • 57
  • 141
  • 175