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

how to tune parameters of custom kernel function with pipeline in scikit-learn

currently I have successfully defined a custom kernel function(pre-computing the kernel matrix) using def function, and now I am using the GridSearchCV function to get the best parameters. so, in the custom kernel function, there is a total of 2…
ZAWD
  • 651
  • 7
  • 31
13
votes
1 answer

SVM in Matlab: Meaning of Parameter 'box constraint' in function fitcsvm

I'm new to SVMs in Matlab and need a little bit of help with it. I want to train a support vector machine using the build in function fitcsvm of the Statistics Toolbox. Of course there are many parameter choices which control how the SVM will be…
cahilx
  • 131
  • 1
  • 1
  • 3
13
votes
2 answers

Scaling data in scikit-learn SVM

While libsvm provides tools for scaling data, with Scikit-Learn (which should be based upon libSVM for the SVC classifier) I find no way to scale my data. Basically I want to use 4 features, of which 3 range from 0 to 1 and the last one is a "big"…
luke14free
  • 2,529
  • 1
  • 17
  • 25
12
votes
4 answers

Outlier detection in data mining

I have a few sets of questions regarding outlier detection: Can we find outliers using k-means and is this a good approach? Is there any clustering algorithm which does not accept any input from the user? Can we use support vector machine or any…
Navin
  • 411
  • 3
  • 9
  • 17
12
votes
1 answer

Soft margin in linear support vector machine using python

I'm learning support vector machine and trying to come up with a simple python implementation (I'm aware of the sklearn package, just to help understand the concepts better) that does simple linear classification. This is the major material I'm…
Jason
  • 2,950
  • 2
  • 30
  • 50
12
votes
3 answers

What is vector in terms of machine learning

I want to understand what is a vector in terms of machine learning. I looked into the below 2 links: https://en.wikipedia.org/wiki/Support_vector_machine https://en.wikipedia.org/wiki/Feature_vector. I couldn't understand it fully. Can someone…
subho
  • 491
  • 1
  • 4
  • 13
12
votes
4 answers

Grid-Search finding Parameters for AUC

I'm trying to find the parameters for my SVM, which give me the best AUC. But i can't find any scoring function for AUC in sklearn. Does someone have an idea? Here is my Code: parameters = {"C":[0.1, 1, 10, 100, 1000], "gamma":[0.1, 0.01, 0.001,…
julianspaeth
  • 205
  • 1
  • 3
  • 9
12
votes
1 answer

How to get all alpha values of scikit-learn SVM classifier?

I need the alpha values, which are the Lagrange multipliers of the SVM dual problem, after training a SVM classifier with scikit-learn. According to the document, it seems that scikit-learn provides only svm.dual_coef_, which is the product of the…
pjhades
  • 1,948
  • 2
  • 19
  • 34
12
votes
2 answers

Python scikit-learn SVM Classifier "ValueError: Found array with dim 3. Expected <= 2"

I am trying to implement SVM Classifier over MNIST dataset. As my parameters are 3 dimensional its throwing the following error: ValueError: Found array with dim 3. Expected <= 2 Following is my code snippet: import mnist from sklearn import…
Hitanshu Tiwari
  • 310
  • 1
  • 3
  • 10
12
votes
1 answer

sckit-learn fit() leads to error after normalising the data

I have been trying this: Create X features and y dependent from a dataset Split the dataset Normalise the data Train using SVR from Scikit-learn Here is the code using a pandas dataframe filled with random values import pandas as pd import numpy…
azuric
  • 2,679
  • 7
  • 29
  • 44
12
votes
1 answer

Sklearn.KMeans() : Get class centroid labels and reference to a dataset

Sci-Kit learn Kmeans and PCA dimensionality reduction I have a dataset, 2M rows by 7 columns, with different measurements of home power consumption with a date for each…
flow
  • 571
  • 1
  • 4
  • 16
12
votes
1 answer

Error in plot, formula missing when using svm

I am trying to plot my svm model. library(foreign) library(e1071) x <- read.arff("contact-lenses.arff") #alt: x <- read.arff("http://storm.cis.fordham.edu/~gweiss/data-mining/weka-data/contact-lenses.arff") model <- svm(`contact-lenses` ~ . , data…
aceminer
  • 4,089
  • 9
  • 56
  • 104
12
votes
3 answers

Why Gaussian radial basis function maps the examples into an infinite-dimensional space?

I've just run through the Wikipedia page about SVMs, and this line caught my eyes: "If the kernel used is a Gaussian radial basis function, the corresponding feature space is a Hilbert space of infinite dimensions."…
12
votes
1 answer

Python : How to find Accuracy Result in SVM Text Classifier Algorithm for Multilabel Class

I have used following set of code: And I need to check accuracy of X_train and X_test The following code works for me in my classification problem over multi-labeled class import numpy as np from sklearn.pipeline import Pipeline from…
user_az
  • 363
  • 2
  • 3
  • 17
12
votes
3 answers

Support vector machines - separating hyperplane question

From what I've seen, seems like the separation hyperplane must be in the form x.w + b = 0. I don't get very well this notation. From what I understand, x.w is a inner product, so it's result will be a scalar. How can be it that you can represent a…
devoured elysium
  • 101,373
  • 131
  • 340
  • 557