Questions tagged [svm]
Support Vector Machines (SVM) are a popular supervised machine learning algorithm that can be used for classification or regression.
580
questions
0
votes
0
answers
949
views
ValueError: bad input shape
I have multilabel problem.
I was using onevsrestclassifier and now i want to use onevsoneclassifier.
...
0
votes
3
answers
1k
views
Why is the accuracy of a LinearSVC not the same as the SDGClassifier?
I'm fine tuning parameters for a linear support vector machine. There are multiple ways to do it, but I wanted to compare LinearSVC and SDGClassifier in terms of time. I expected the accuracy score to ...
1
vote
0
answers
58
views
Support Vector Machines
I have ASCII data which converted from raster data in ArcGIS. I would like to use Support Vector Machine (SVM) algorithm to create a flood prediction map. My question is that can I use ASCII file ...
1
vote
1
answer
239
views
Standardization on training and split data
I am confused on which of the following should be used for standardization:
method 1: fit transforming training data and only transforming test data
...
0
votes
1
answer
6k
views
GridSearchCV() to fine tune outputs ValueError and FitFailedWarning
I would like to fine tune some parameters for my linear SVM.
This is the code:
...
0
votes
1
answer
28
views
Including validation set in my code for a Linear SVM classifier returns a Type error
I'm using a predict function for a linear SVM classifier:
...
0
votes
1
answer
123
views
How to include validation set in the pipeline to tune parameters for an SVM?
I have a dataset already divided into train, test and validation set. How can I insert the validation in my pipeline?
Code:
...
1
vote
1
answer
157
views
Support Vectors of SVM
I have read somewhere that the value of slack variables of support vectors is not 0. Does that mean the points lying in the wrong region e.g a positive point lying in the negative region will also be ...
-1
votes
1
answer
205
views
In SVM, what do the points and axis represent?
Usually the axis represent features and points represent the value. But for example in case of document classification, where each document is represented as a feature, what do the axis and points on ...
3
votes
1
answer
131
views
When does it make sense to choose gradient descent for SVM over liblinear?
I understand using gradient descent methods with SVM is intractable if you've used the kernel trick. In that case, best to use libsvm as your solver.
But in the case that you are not using a kernel ...
1
vote
1
answer
131
views
Encoding for classifiers
I have some doubts regarding encoding (i am not familiar with tasks like these) categorical variables in order to use them as parameters in a model like logistic regression or SVM.
My dataset looks ...
0
votes
1
answer
59
views
Variables for SVM [closed]
I would like to predict if an email is spam or not spam based on the information that I have, i.e. date, email address, subject and text.
Three of these parameters are text data, so they would need to ...
0
votes
1
answer
75
views
Binary classification: how to transform features in real numbers?
I want to train a binary classification algorithm for spam detection using labeled data set. The dataset has the following features:
...
0
votes
0
answers
333
views
How to change voice features in python without affecting speech/language features?
I am trying to build a CNN model which should be able to identify the language being spoken in an audio file. I have extracted the MFCC matrix (for 13 coefficients) for each audio file and trained it....
1
vote
0
answers
17
views
Adaptive Sampling Strategies for SVM?
I am an Engineer interested in creating a surrogate model of a certain phenomenon in the context of reliability engineering. Essentially my quantity of interest is the Limit state function/stability ...
2
votes
1
answer
701
views
How does C have effects on bias and variance of a Support Vector Machine?
The minimization problem for SVM can be written as-
$$\overset{\text{min}}{\theta} C\sum_{i = 1}^{m}{[y^icost_1(\theta^Tx^i) + (1-y^i)cost_0(\theta^Tx^i)]} + \frac12\sum_{j = 1}^n{\theta_j}^2$$
Now, ...
0
votes
1
answer
73
views
Classifiers and accuracy
I would like to ask you how to use classifier and determine accuracy of models.
I have my dataset and I already cleaned the text (remove stopwords, punctuation, removed empty rows,...).
Then I split ...
0
votes
1
answer
11k
views
NotFittedError says this StandardScaler instance is not fitted yet while using inverse_transform() [closed]
I have a dataset and i have used Support Vector Regression.So i needed to use StandardScaler module from sklearn.preprocessing fro Feature Scaling.
After training my model when i came to predict it ...
4
votes
2
answers
7k
views
Can we use BERT for only word embedding and then use SVM/RNN to do intent classification?
According to this article, "Systems used for intent classification contain the following two components:
Word embedding, and a classifier." This article also evaluated BERT+SVM and Word2Vec+...
1
vote
1
answer
43
views
What is lagrangian?
I'm watching an SVM tutorial.
At 6:38 he mentions lagrangian, which is a term I'm not familiar with.
So I googled it, hoping to find the Wikipedia article about it, ...
0
votes
1
answer
74
views
Single image feature reduction at inference time : SVM
I am trying to train a SVM classifier using scikit-learn.. At training time I want to reduce the feature vector dimension.
I have used PCA to reduce the dimension.
...
0
votes
2
answers
468
views
i'm using GridSearchCV to find parameter C for SVC() classifier present in sklearn.svm . I'm not getting the optimal result desired
this is a screenshot of my code. i used abc.best_estimator_ (my GridSearchCV model) to find out best results. As you can see grid has values of C=1 and C=100 along with other values. abc....
2
votes
2
answers
2k
views
Don't understand why I get an inverse ROC curve for SVM (Python)
I build an SVM classifier but get an inverse ROC curve. The AUC is only 0.08. I've used the same datasets to build a Logistic Regression classifier and a Decision Tree classifier, and the ROC curves ...
1
vote
0
answers
196
views
Accuracy gain vs amount of data in Neural Networks
There's a theoretical question I tackled upon in the excellent book Neural Networks and Deep Learning by Michael Nielsen, which I would love to discuss about.
The ...
3
votes
1
answer
174
views
Support Vector Machines with soft margin: solving the dual form
I am currently struggling with finding an analytical solution for the $\alpha_k$.
I have derived the following constrained optimization problem:
$$
L = \sum_{i=1}^{N} \alpha_i - \frac{1}{2} \sum_{i=1}^...
1
vote
2
answers
101
views
How does SVM classify images?
I have read about SVM and understood that for complex divisions, the SVM theoretically plots the data into a higher dimensional plane such that the in the new dimension the data is linearly separable ...
2
votes
1
answer
104
views
Stacked Model performance?
I am currently working with a dataset that seems very easily separable and I have an accuracy of 99% for SVM (NN-98%, RF-98%, DT-96-97% and I have checked for leakage & overfitting). As part of my ...
1
vote
1
answer
1k
views
How to use unigram and bigram as an feature on SVM or logistic regression [closed]
How to use unigram and bigram as an feature to build an Natural Language Inference model on SVM or logistic regression?on my dataset i have premise, hypotesis and label column. I'm planning to use the ...
3
votes
1
answer
699
views
Decision tree and SVM for text classification - theory
I used 4 classifiers for my text data: NB, kNN, DT and SVM. As for NB and kNN I fully understand how they work with text - how we can count probabilities for all words in NB and how to use similarity ...
1
vote
2
answers
32
views
Biasing SVM algorithm towards particular subset of data
I'm training an SVM model for sentiment analysis, based on social media data eg. tweets.
The model will be trained using a small selection of a particular company's tweets in order to classify new ...
4
votes
1
answer
2k
views
Interpretation of scikit-learn one class svm scores
How can I interpret the scores generated by the function score_samples(X) from a scikit-learn OneClassSVM model? Is there a way ...
1
vote
0
answers
713
views
Is C = 1/lambda in SVM?
I was looking through the documentation for SVM.SVC where it said:
C: float, default=1.0
Regularization parameter. The strength of the regularization is inversely proportional to C. Must be strictly ...
0
votes
1
answer
5k
views
ValueError: Found input variables with inconsistent numbers of samples [duplicate]
I am trying to do svm model training and it gives this error:
ValueError: Found input variables with inconsistent numbers of samples: [91, 212]
Code:
...
0
votes
1
answer
213
views
Text Classification on a very small data set with a lot of classes
I have a data set consisting of 455 rows spread over 21 different classes. The data set is imbalanced as well as you can see below.
...
2
votes
1
answer
79
views
What supervised machine learning model can be used to generate a scorecard-like result?
A scorecard is typically used in Credit Application. One very common model for developing a credit scorecard is logistic regression since it has well-defined probabilities.
Apart from logistic ...
2
votes
1
answer
252
views
PCA shows overlapping boundaries, then why SVM performs best
I am trying to understand which model might work for a given problem before trying the models, I find this case against my knowledge. Please guide what I am missing. I am new to Data Science.
Here is ...
3
votes
2
answers
530
views
Which model is better for incremental learning?
I'm trying to implement face recognition. I'm planning to use some model (like DeepFace) to extract discriminative features and then use a classifier to recognize the faces. I'm confused as to which ...
1
vote
2
answers
108
views
Identify the parameter causing the anomaly in a multivariate dataset
I have a payment transaction dataset with a large number of predictor variables. I am trying to build a model for anomaly detection and I have evaluated various algorithms/approaches for the same like ...
1
vote
3
answers
54
views
What is the 1 Unit in the contraint of SVM: $y_i(wx_i+b) \geq1$
I am following this note on SVM.
The constraint, $y_i(wx_i+b) \geq 1$, basically said all inputs, $x_i$, lie at least 1 unit away from the hyperplane on the correct side.
What does it mean by 1 unit?...
1
vote
1
answer
79
views
Tuning SVM C parameter
I would like to ask for help regarding my model.
I have a dataset of preprocessed images and I performed a binary classification with SVM on Python.
I tuned the value of the c parameter from 0.001 to ...
1
vote
1
answer
30k
views
AxisError: axis 1 is out of bounds for array of dimension 1
I've used svm classifier. Now I need to construct the confusion matrix. Here is the code that I have used.
...
2
votes
4
answers
369
views
How to improve results in classification problems (SVM, Logistic Regression and MultiNaive Bayes)?
I am new on Machine Learning and building models but a lot of tutorials has given me the chance to learn more about this topic.
I am trying to build a predictive model for detecting fake news.
The ...
1
vote
0
answers
72
views
If we use a generalized quadratic loss in a SVM model, what generalization performance bounds can be derived?
If we write an objective function: $$\frac{1}{2}||\vec{w}||^2 + C \sqrt{\vec{\xi}}' S \sqrt{\vec{\xi}}$$ with the usual SVM constraints, and $S_{i,j} = e^{-\gamma || \vec{x_i} - \vec{x_i}||^2}$, where ...
1
vote
0
answers
297
views
Hyperparameter tuning one-class svm
I have a problem where I am trying to apply a one-class svm to detect outliers. I am training on a dataset of true cases using a one-class radial svm and then predicting for both false and true cases. ...
0
votes
1
answer
122
views
Amount of data needed for deep learning vs support vector machine
I often read about the fact, that the amount of data to train and get a generalizing model for a deep learning algorithm is much higher in comparison, e.g. to a support vector machine. It makes sense, ...
0
votes
1
answer
555
views
Suspiciously low False Positive rate with Naive Bayes Classifier?
I am performing phishing URL classification, and I am comparing several ML classifiers on a balanced 2-class data-set (legitimate URL, phishy URL).
The ensemble and boosting classifiers such as ...
0
votes
1
answer
76
views
Two-class model with predicted scores needed - classification or regression approach
In my problem, step one is to build a model to classify cases as one of True or False (1 or 0 could also be used obviously). Once the optimum model is found, step two is to retrieve probabilities for ...
0
votes
1
answer
74
views
Having trouble understanding the x and y axis in SVM when training and testing data
I wrote some code based on this article.
In the code in the article they have created a partition of 80 percent test and 20 percent data
...
1
vote
1
answer
83
views
How to use a RBF kernel to create a "Kernel Space" using the similarity of each pair of point?
I am trying to use Semi-Unsupervised clustering using reinforcement learning following this paper.
Assume I have n data-points each of which has d dimensions. I also have c pairwise constraints of ...
1
vote
1
answer
181
views
Can I use SVC() as a base_estimtor for ensemble methods?
I am currently testing out a few different ensemble methods on my dataset. I've heard that you can also use support vector machines as base learners in boosting and bagging methods but I am not sure ...