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

How to input parameters in GridSearchCV for AdaBoostClassifier. ERROR: Invalid parameter learning_rate for estimatoR

I am trying to tune parameters for my model using GridSearchCV. However, I keep getting the same error telling me that the parameter grid that I am passing contains parameters that are invalid. for example, it keeps telling me invalid parameter…
1
vote
0 answers

What is the partial derivative of sklearn's SVM (Hinge) loss function with regards to the input?

Does sklearn have a method to get out the gradient of the loss function w.r.t the input for an SVM that you have trained? I am also using a Gaussian (rbf) kernel.
MangLion
  • 153
  • 5
1
vote
0 answers

How to deal with C stack usage error in R

I running the below SVM code in R model<-ksvm(data$size_category~.,data=data_training,kernel="stringdot"). But I am getting the error C stack usage 15924720 is too close to the limit.I am not able to figure out why this error is happening.
Bet
  • 13
  • 4
1
vote
1 answer

SVM classification - Bad input shape Error

Im having an error bad input shape I tried searching but I can't understand yet since im new in SVM. train.csv testing.csv # importing required libraries import numpy as np # import support vector classifier from sklearn.svm import SVC import…
1
vote
1 answer

An example of classifying a 5 dimensional dataset using SVM?

I have tried to find one online but failed. the 5D dataset is a list of lists like this [[0,0,0,1,0], [0,0.5,0.5,0,0], [0,0.33333,0.33333,0.33333,0], [1,0,0,0,0], ......] Thanks.
1
vote
0 answers

What is The Benefit of Support Vector Machines>

I have learned about support vector machines, and gotten an equation for the cost function: J(M,D) = C/2 |w|^2 + sum((D_hinge(x,y,M)) moreover, I understand that when you take the gradient of this and set it equal to 0, then solve for w, you get : w…
otj202
  • 51
  • 1
  • 3
1
vote
1 answer

The significance of the shape of the SVM margin

I am having difficulty interpreting the shape of the SVM margin. In both of the following examples, the RBF kernel is used: Here the separator is almost the same in the two cases. In the case of the larger gamma (the second example), it is the…
AlwaysLearning
  • 7,257
  • 4
  • 33
  • 68
1
vote
1 answer

SVM ValueError: Input contains NaN, infinity or a value too large for dtype('float64')

Please help me for this! I don't know why this error happened when I try input some text for detection the classification. This is my code for training the data. How to fix it ? from sklearn.model_selection import train_test_split X_train, X_test,…
Yota
  • 35
  • 6
1
vote
1 answer

R: Apply SVM function for group by in data frame

I have a data frame (df) that looks like that: Value Country ID 1 21 RU AAAU9001025 2 24 NG AAAU9001848 3 17 EG ACLU2799370 4 2 EG ACLU2799370 5 56 RU ACLU2799370 I want to run SVM classifier for outlier…
Matan Retzer
  • 65
  • 1
  • 7
1
vote
0 answers

Interpret SVC and GridSearch results

I am working on a texture classifier using scikit-learn svm svc as a model. I am a bit confused about some of the results I get, mainly why the choices of parameters gamma and C have such a big influence on my results. So here is a short description…
Naev47
  • 23
  • 4
1
vote
1 answer

SVMLight on OpenCV HOG Descriptor

I am trying to use SVM Light to learn a classifier for the OpenCV2.2 HOG Descriptor. I get a float vector output from the HOG descriptor. After reading the SVMLight documentation, i still cannot understand what is the format of the input train and…
cyw
  • 163
  • 3
  • 11
1
vote
2 answers

How to use trained text classification model

I implemented an SVM model that can classify given text into two categories. The model was trained and tested using data.csv data set. Now I want to use this model with live data. To do that I used the pickle python library. First I saved the…
Dinuka
  • 37
  • 1
  • 9
1
vote
1 answer

Is there a reason why a feature only present in a given class is not being predicted strongly into that class?

Summary & Questions I'm using liblinear 2.30 - I noticed a similar issue in prod, so I tried to isolate it through a simple reduced training with 2 classes, 1 train doc per class, 5 features with same weight in my vocabulary and 1 simple test doc…
Damiox
  • 622
  • 4
  • 12
1
vote
1 answer

Was StratifiedKFold really used by GridSearchCV?

After using GridSearchCV, is there any way to find out if StratifiedKFold was really used instead of KFold? As an estimator I used SVC (Support Vector Machine) with a cv=10. I know that the documentation (scikit-learn Version 0.21.3) says that…
Code Now
  • 711
  • 2
  • 9
  • 20
1
vote
1 answer

Text classification into predefined categories

I am trying to classify text data into a few categories. But in the data set, there can be data that does not belong to any of the defined categories. And after deploying the final product, the product should be deal with text data that does not…
Dinuka
  • 37
  • 1
  • 9