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

'GridSearchCV' object has no attribute 'support_vectors_'

I am trying to find best parameters using GridSearch and then also find out support vectors using the best parameters. Here is the code: tuned_parameters = [{'kernel': ['linear'], 'C': [0.00001,0.0001,0.001,0.1,1, 10, 100, 1000], …
Shubham Bajaj
  • 309
  • 1
  • 3
  • 12
1
vote
1 answer

SKLearn Error with Pipeline and Gridsearch

I would like to first split my data in a test and train set. Then I want to use GridSearchCV on my training set (internally split into train/validation set). In the end I want to collect all the testdata and do some other things (not in the scope of…
Gesetzt
  • 47
  • 5
1
vote
0 answers

TensorFlow Keras SavedModel empty variables folder

I have a TensorFlow keras model that looks like the following: model = tf.keras.Sequential([ feature_layer, tf.keras.layers.Dense(64, activation='relu'), tf.keras.layers.Dense( 6, kernel_regularizer=l2(0.01),…
1
vote
2 answers

How can I plot two ROC Curves on the same plot using PRECREC package

I am using the precrec package in order to evaluate multiple models and plotting ROC and PR-ROC. I want to do a model comparison at the end, but it seems I can't plot both models on the same plot. Here is my attempt:…
Kermit
  • 3,112
  • 2
  • 10
  • 34
1
vote
2 answers

SVM binary classifier predicts one class for all of test data

I have a classification problem with 10 features and I have to predict 1 or 0. When I train the SVC model, with the train test split, all the predicted values for the test portion of the data comes out to be 0. The data has the following 0-1…
1
vote
0 answers

shortest path dependency between three entities using spacy

I'm trying to build ternary intra sentence relationships. One of the methods I'm considering is shortest path dependency algorithm with pos tag sequence , shortest path dependency sequence which will be used as features to a kernel based SVM. I'm…
sr33kant
  • 35
  • 3
1
vote
1 answer

How to write a function to translate data to higher dimension

If you are familiar with SVM, we can move data to higher dimension in order to deal with non-linearity. I want to do that. I have 19 features and I want to do this: for any pair of features x_i and x_j I have to find : sqrt(2)*x_i*x_j and also…
user12036223
1
vote
3 answers

How to use predict_proba at SVM Sentiment Analysis

I applied predict_proba on classfication problem. I have some experience with building classification models in R but it's my first time with Python's sklearn. So the the problem is: In sklearn after fitting I can't find a way to access…
1
vote
1 answer

"There were missing values in resampled performance measures" But just for huge data sets

For "small" data set it works just fine. However, for one of my biggest sets (n=498.706) the model give me the error ( see bottom ). Any ideas what may cause this issue? Code Snipet # Binary just the target…
Flocke Haus
  • 55
  • 1
  • 6
1
vote
1 answer

100% error rate on test set with one class svm

I am trying to detect outlier images. But I'm getting bizarre results from the model. I've read in the images with cv2, flattened them into 1d-arrays, and turned them into a pandas dataframe and then fed that into the SVM. import numpy as np import…
Bari Tala
  • 37
  • 8
1
vote
0 answers

confusionMatrix - Error in !all.equal(nrow(data), ncol(data)) : invalid argument type

I've got some struggle creating a conditionMatrixin r using the code below. I've googled the issue and found out that it seems to be realted to a divergence between the train - and test syet, but I've got absoluteley no clue what's causing this…
Flocke Haus
  • 55
  • 1
  • 6
1
vote
0 answers

Error: error: (-215:Assertion failed) samples.cols == var_count && samples.type() == 5 in function 'cv::ml::SVMImpl::predict'

I want to predict and extract "Ocular region/ eye region" I trained My SVM on dataset of eyes(positive images) and others(negetive images) it is predicted well (1) when image has (eye) and (0) for other Now I add (haarcascde_eye.xml) file for…
sabeen kanwal
  • 607
  • 1
  • 5
  • 16
1
vote
0 answers

Equivalent of scitkit-learn's decision_function?

In scikit-learn, one can train a OneClassSVM with rbf kernel; and it will provide a "decision_function" which, when supplying new data to predict, will supposedly tells you the distance from the new data point to the separating hyperplane; (but the…
johnjps111
  • 1,160
  • 9
  • 24
1
vote
1 answer

Is there any need to scale data in SVM if my weight vector is binary in nature?

My weight vector is SVM training (using Libsvm) will have only feature number and then 1 or 0 i.e representing whether present or NOT present. it would be like below libsvm format. 1 1:0 2:1 3:0 4:1...9600:1 0 1:1 2:0 3:1 4:0...9600:0 .... As all…
Krishna Chaitanya M
  • 227
  • 1
  • 6
  • 12
1
vote
1 answer

Sign Language Glove project from GitHub: Help in understanding code

I'm very new to Python and I'm trying to replicate this Sign Language Glove project heree with my own hardware for a first practice into Machine Learning. I could already write data in CSV files from my accelerometers, but I can't understand the…
1 2 3
99
100