Questions tagged [svm]

Support Vector Machines (SVM) are a popular supervised machine learning algorithm that can be used for classification or regression.

Filter by
Sorted by
Tagged with
1
vote
2answers
18 views

Which scoring for GridSearchCV is best, when imbalanced multiclass dataset?

I have an unbalanced multiclass dataset (GTSRB) and want to optimize the hyperparameters of an SVM through GridSearchCV. I know that accuracy is not suitable for scoring in this case. Which evaluation ...
0
votes
0answers
6 views

How can I classify single fused gray scale image in python ? is it possible to binary classsify single output image with Ground Truth image?

I want to calculate the precision, recall, and accuracy of the single predicted image(y_pred) with the Ground truth (y_true) image. I have only two binary class (0 and 1) so my question is, ** is it ...
0
votes
0answers
13 views

Do not scale Hog features?

when I train LinearSVC with the Hog features extracted from the Fashion-MNIST dataset then I get better results if I don't use StandardScaler before training than I use it. ...
1
vote
1answer
20 views

K-fold-cross-validation if training dataset is much smaller than test dataset?

I'm a beginner in machine learning and I have a special case in which I have only a small training dataset of about 500 images and a test dataset of 10,000 images. Does it still make sense to do a 10-...
0
votes
0answers
11 views

Feature importance in SVM

Why is there no command for feature importance in SVM like the one provided in Random Forest feature_importance_ from ...
0
votes
0answers
21 views

How can I map the sample from the original feature space to the new kernel feature space? (Sk-learn)

Let's say I have a very basic SVM model, implementin sk-learn: clf = SVC(kernel='rbf', class_weight=weights, gamma=gamma) clf.fit(X,y) X is the sample space with ...
0
votes
1answer
34 views

Non-Convex Constraints for Classification Problems

I am willing to create a hypothetical non-convex constraints for the purpose of practising nonlinear classification using an algorithm. I thought of such constraints in the form: $x^TAx + Bx \leq c$. ...
0
votes
0answers
9 views

How to upload a sklearn SVM model as a chrome extnesion?

I have trained an SVM/Logistic regression machine learning model using its scikit implementation. But now I want to do the same with Tensorflow/Keras. This is for easy conversion to Tensorflow.js. ...
1
vote
1answer
30 views

How to deploy machine learning models as a chrome extension?

I have trained a stance detection model using SVMs. Wanted to know how can I deploy this as a chrome extensions. I do understand that the question is a bit broad but any links, suggestions etc. will ...
1
vote
1answer
20 views

Implicit feature selection

I have heard that Random Forest and other tree based machines apply some kind of implicit feature selection. My Question is: Does this also apply for machines like the SVM? As far as I understand is ...
1
vote
1answer
22 views

(Scikit-learn) differences between LinearSVC, 'linear' kernel SVC and poly kernel SVC with degree 1

I would like to know the differences between: linearSVC() SVC(kernel='lineaer) ...
0
votes
1answer
32 views

SVM hyperplane margin

so that $H_0$ is equidistant from $H_1$ and $H_2$. However, here the variable $\delta$ is not necessary. So we can set $\delta=1$ to simplify the problem. $$w\cdot x+b=1 $$ and $$w\...
0
votes
0answers
9 views

Understanding the ||w|| = 1 constraint for SVMs

Is it correct to say that the reason why ||w|| is set to 1 in the formula for the geometric margin is that it then is the sane as the functional margin (i. e. gives the same information) why still ...
1
vote
0answers
27 views

Difference between C and lambda in SVM

I've been taking the coursera machine learning course and The instructor said that if ( C = 1/lambda ) then the learning algorithm would reach the same optimal value of theta does this mean that ...
2
votes
2answers
85 views

Binary classfication vs One-class classification

Why do we need samples of both classes for the training of binary classification algorithms, if one-class algorithms can do the job with only samples from one class? I know that one-class algorithms (...
0
votes
0answers
13 views

How to obtain the predictions of SVM model on single input?

So, I am trying to build a Spam detection model. It is trained on a dataset consisting of about 3500 messages. I used SVM to build a model. But, if I now wish to find out whether a message is spam or ...
0
votes
1answer
19 views

Sliding window approach using SVR & LightGBM

I'm working on a multivariate time series forecast using a couple of ML algorithms (Neural Networks, Support Vector Machines & Gradient boosting algorithms). I need to measure the performance of ...
0
votes
2answers
36 views

Why use deep neural networks over methods like linear regression or SVM?

This is a very broad question, but I was wondering why researchers would choose a deep neural network over linear regression or SVM? As in, what are the advantages and disadvantages of both?
0
votes
0answers
7 views

Soft Margin SVM kernels

Kernels are used to map datasets into higher dimensions so that they could be linearly separable. However, if we introduce the slack variable in the soft margin SVM, we are allowing some mistakes, and ...
0
votes
0answers
10 views

Support Vector Machine (SVM) kernels

I learned that Kernels in SVMs are used to map the datasets into a higher dimension to make it more linearly separable, and the kernels will produce only the result, so we don't even have to know what ...
1
vote
1answer
29 views

How Linear SVM Regression and Multiple Linear Regression different in terms of the regression result?

They starts from the same equation as below. y = w*x + b But they solve it differently. MLR specified the w and b by minimizing the square error whereas SVM specified w and b by minimizing the loss ...
1
vote
1answer
52 views

svm.LinearSVC: larger max_iter number doesn't always increase the accuracy/precision/recall

Background: Supervised machine learning Data shape 10+ features, target = 1 or 0 only, 100,000+ samples (so should be no issue of over-sampling) 80% training, 20% testing train_test_split(X_train, ...
0
votes
2answers
41 views

SVM Loss Function

I have learned that the hypothesis function for SVMs is predicting y=1 if transpose(w)xi + b>=0 and y=-1 otherwise. However, according to the loss function above, it implies that transpose(w)xi + b ...
0
votes
0answers
12 views

Quadratic programming and Lagrange multiplier in SVM

I am a little confused because for some simple functions and constraints, using the Lagrange multiplier will be able to solve for the variables. However, in the SVM Lagrange expression, I learned that ...
0
votes
0answers
14 views

About SVM cost function and Lagrange

I just watched the MIT video on the intuition and mathematics behind SVMs, and overall, I learned that the objective is to minimize the margin or the distance between the support vectors with some ...
0
votes
1answer
25 views

Why my svm.SVC.fit( ) (linear kernal) run so long time?

I am using sklearn.svm.SVC( ) to train & test my dataset. 80% are used for training, 20% are used for testing. Here is my Python code: ...
0
votes
0answers
7 views

Implementing Linear SVM with One-sided Soft Margin

In my use case, I have two sets of datapoints $X$ and $Y$ which we want to "approximately" linearly separate. These sets represent the entire population, so I'm not concerned about generalization. In ...
0
votes
1answer
23 views

Feature addition/ subtraction and SVM model accuracy

I am working on a text classification problem where I would like to improve the accuracy of my model. Presently, I am using SVM with linear SVC and OneVsRestClassifier. The model should correctly ...
0
votes
0answers
21 views

GridSearch on imbalanced multi-class dataset

I have an imbalanced multi-class dataset (GTSRB) and would like to use GridSearch to determine the hyperparameters for an SVM. As metric for the evaluation I chose F1 with average macro. ...
0
votes
0answers
11 views

how use RBF for primal model of svm?

I know if we want to solve primal model of non-linear SVM, we have to generate new features. for example for kernel (1+xz)^2 for primal problem for any pair of features x1 and x2 we have to generate: ...
0
votes
1answer
17 views

How can I imporve accuracy for text classification and mapping using SVM?

I am working on a problem where I need to predict the text corresponding to another text in my training data file. For example: if I have value like the software in one of my columns and another ...
1
vote
0answers
15 views

Designing Custom Kernel from my Mathematical model

I derived a mathematical model for a porous system and the final function looks like this , after going through the Mercers Theorem and it condition for a kernel i would love to write a SVM kernel ...
0
votes
0answers
14 views

solving svm without using largeagian?

I wrote a SVM model in ampl. (multi classification). I am sure the model is right based on SVM. I didn't use lagragian just solved linear svm . But the result are not make sense to me . most of ...
0
votes
1answer
14 views

can we have different features for different hyperplanes in SVM?

is it possible if we have different features for different classes of svm? For example one of the hyperplane: $$w_1\cdot \text{age}+ w_2 \cdot \text{ trip duration} +w_3 \cdot \text{ income}$$ and ...
0
votes
0answers
23 views

SVM - Shuffle image data before GridSearchCV or not?

I have different image datasets, most of them are sorted by class, others are already mixed. For each of these data sets, I would like to train one SVM (in Python with Scikit-Learn), whereby in each ...
0
votes
0answers
17 views

Similarity of perceptron criterion and SVM

In the book "Neural Networks and Deep Learning" by Aggarwal there is an exercise 2.10.1: Consider the following loss function for training pair $(\overline{X},y)$: $$L=max(0, a -y(\overline{W} \...
0
votes
2answers
40 views

Confusion on result of K-Fold Cross Validation and Independent Test set

I am relatively new in Machine Learning. I am using Random Forest and SVM for a project. Where I did a ...
1
vote
0answers
29 views

SVC classification not working at all on MNIST dataset

I'm sure I probably did something stupid but I'm trying to fit a simple SVC classifier on MNIST dataset as an example, and it completely failed by only predicting result 1 (sometimes 7 depends on how ...
2
votes
0answers
59 views

Why are the regions/decision boundaries overlapping with multi-class classification using SVM in sci-kit?

I am using the SVM in scikit-learn library for doing multiclass classification. I am wondering why these regions (decision boundaries) are overlapping (as seen in the picture below)? Could someone ...
0
votes
0answers
66 views

R SVM Predict - Error in predict.svm: test data does not match model

I started with a data frame of 23,515 rows and 3 columns. I split the data 70/30 into training/testing. I am fitting a classification model with SVM from the e1071 package to predict variable MISSING. ...
2
votes
1answer
31 views

Does it matter whether we put regularization parameter ($C$) with error or weight term in Kernel ridge regression?

Kernel ridge regression associate a regularization parameter $C$ with weight term ($\beta$): $\text{Minimize}: {KRR}=C\frac{1}{2} \left \|\beta\right\|^{2} + \frac{1}{2}\sum_{i=1}^{\mathcal{N}}\left\|...
1
vote
2answers
53 views

Don't understand classification equation for hard margin SVM

I am trying to get a grasp of hard margin SVMs. In the lecture I am watching the professor talks about a classification equation which when a positive sample is input, returns a value of $1$ or more; ...
1
vote
0answers
22 views

How to Interpret output Coefficients with python sklearn Support Vector Regression?

I'm looking to interpret the output coefficients from my SVR model. For my case, the rbf kernel has the highest in-sample and out-of-sample performance. However, ...
0
votes
0answers
38 views

How to detect anomalies (errors and exceptions) in log files?

Is this a good approach? So I'm working on a Root Cause Analysis system which should help find the cause/the root error of failed system builds (packaged in a tarball), through the analysis of log ...
4
votes
1answer
214 views

Mathematical formulation of Support Vector Machines?

I'm trying to learn maths behind SVM (hard margin) but due to different forms of mathematical formulations I'm bit confused. Assume we have two sets of points $\text{(i.e. positives, negatives)}$ one ...
1
vote
1answer
45 views

Naive Bayes and Support Vector Machine (NBSVM) Classification

I am relatively new to datascience and have a question about NBSVM. I have a two class problem and text data (headlines from the newspaper). I want to use NBSVM to predict whether a headline has the ...
1
vote
0answers
29 views

Logistic Regression performing better than SVM with a Gaussian kernel performing better than a linear SVM

I am very new to machine learning. I am working with a data set, and my algorithm for logistic regression (with lasso regularization) is performing fairly well (~0.8 AUC), my SVM with a Gaussian ...
1
vote
0answers
27 views

Version of Perceptron

If we change the $ywx<0$ condition (for performing update) to $ywx<1$ like in SVM (but without adding regularization to maximize the margin), is there any difference from the basic perceptron (...
0
votes
0answers
7 views

Get sequential model to output probabilities with pystruct

I have implemented a sequential model using Pystruct. The model I use is BinaryCLF and as a learner the StructuredPerceptron. So far, when I test the prediction of my model, I give as an input the ...
2
votes
0answers
10 views

Confusion regarding prediction results of SVM and ANN on feature vectors

I am making a custom image classifier using Transfer Learning on Inception V3. I have 3 classes of images with ~6K images each. The input dimension of the network is 500X500 and the output of the ...