Questions tagged [svm]

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

170 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1 vote
0 answers
22 views

SVM Marginal line query

In SVM, why are marginal lines drawn such that they touch some data points (support vectors)? Isn't the classification more accurate when no point is touched?
Apoorva's user avatar
  • 287
1 vote
0 answers
56 views

How to handle unclassifiable data in the dataset

Premise: Classification problem Input is three text fields Output classes are A, B, A&B (Note: A and B are not always exclusive though usually are, hence the 'A&B' class) Sci-Kit Learn is the ...
Chor Hatara Hud'u Keturi's user avatar
1 vote
1 answer
97 views

How should I engineer features for Named Entity Identification task?

I was working on Named Entity Identification (not recognition) task. In this NLP task, given a sentence, model has to predict whether each word (aka token) is named entity or not. The dataset used ...
Rnj's user avatar
  • 225
1 vote
3 answers
385 views

How do I deal with unbalance classes in a stock market prediction problem?

I am working on a prediction model to predict whether a stock should sell, hold or buy in n days. Each day (or row in the dataset), I classify whether this should ...
user3118602's user avatar
1 vote
0 answers
168 views

What is the best way to flatten my data to be used by an SVM algorithm?

I am trying to classify data from an 8 channel SEMG sensor (different gestures) by using an SVM. So far, I have managed to record the data and for each channel, I've calculated 7 appropriate features, ...
Tomáš Buchta's user avatar
1 vote
0 answers
62 views

One-class SVM formula

Recently I have been studying one-class SVM and am a little bit confused about the offset $\rho$. The common optimization problem is to find a function $f(x)= w^\top x-\rho$ by solving $$\begin{array}...
Zhou Wang's user avatar
1 vote
2 answers
239 views

Gaussian Kernel faster than Linear

I have a Dataset with 580 samples and 7 features. I compared the time between three kernels: Linear, Quadratic and Gaussian and using RandomizedSearchCV as the following: ...
Felipe's user avatar
  • 123
1 vote
0 answers
224 views

Interpreting one-class SVM

I am new to SVM (one-class) and was practically investigating it. Got some weird result that I can not explain. Let me demonstrate by some small reproducible code and visualization: ...
user3363813's user avatar
1 vote
1 answer
605 views

Support vector machines in R: Finding the equation of a hyper plane (in 6 dimensions) and showing it's correct

...
Diesel Blue's user avatar
1 vote
0 answers
23 views

Machine learning model (neural network or SVM) for unequal feature matrices size

I have feature matrices obtained from visual bags of words model for various dictionary sizes. Example, Nx5, Nx10, …., Nx15000. Where N is the number of samples and 5, 10, …15000 are the visual ...
PManjunatha's user avatar
1 vote
1 answer
1k views

Bert and SVM classification

I'm trying to understand the concepts in the title and how they fit into the task of binary classification. According to my understanding so far, you can encode text using various feature-extraction ...
Bula's user avatar
  • 111
1 vote
0 answers
62 views

SVM is margin determined by nearest datapoint or nearest datapoints?

I am studying support vector machines and different resources seem to define the margin differently. Some define the margin as 2 times the distance to the nearest datapoint. Others define the margin ...
phil's user avatar
  • 141
1 vote
0 answers
128 views

SVM with gradient descent

The constrained optimization problem in SVM is given by min 1/2 ||w||^2 s.t y(i)(w^T x(i) + b >= 1 for all i Now converting this to an unconstrained optimization problem gives the lagriangian L as ...
Urooj's user avatar
  • 111
1 vote
0 answers
645 views

SVM on BERT-Embeddings with very small dataset does not converge

I am trying to reproduce the results from this paper where they use a linear SVM on top of BERT-Embeddings for text-classification. They use the average of the token-embeddings which results in a 768 ...
chefhose's user avatar
1 vote
0 answers
337 views

Why Imblearn pipeline gives very different results when used scaler and under sampling method swapped

I am using the Kaggle's credit card fraud detection dataset (https://www.kaggle.com/mlg-ulb/creditcardfraud) In order to create a balanced datasets I was testing RandomUnderSampler() and NearMiss(). I ...
Neo's user avatar
  • 11
1 vote
0 answers
67 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 ...
Ogun Barutcu's user avatar
1 vote
0 answers
20 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 ...
user103416's user avatar
1 vote
0 answers
266 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 ...
Jjang's user avatar
  • 111
1 vote
0 answers
904 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 ...
ChaoS Adm's user avatar
  • 141
1 vote
0 answers
353 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. ...
A_Murphy's user avatar
1 vote
0 answers
65 views

How to plot the hyperplane for multiclass target variable in SVM?

Please suggest me how can I draw the hyperplane for a 7 class target variable. I'm doing my project in python 3.7 in Spyder.
user9544852's user avatar
1 vote
0 answers
31 views

What is the kernel matrix used for in the kernel trick?

I have $n$ linearly inseperable datapoints, $x_1 \dots , x_n$. I use the kernel trick to map and compute the dot product in higher dimensions (without actually mapping / transforming the data). ...
user13341805's user avatar
1 vote
0 answers
169 views

Do I have to wrap multiclass SVM in OneVsRestClassifier()?

I am using an SVM for mulitclass classification between 3 labels (1,0,-1). I thought this could simply be done by using SVC(decision_function_shape = 'ovr') in my ...
Hamish Gibson's user avatar
1 vote
0 answers
190 views

T-SNE good clustering but SVM classification poor

I am trying to classify in 4 different classes, paragraph embedding vector computed with doc2vec using an non-linear svm over them. When I visualize the embeddings using tensorboard t-sne I can see ...
Luca Massarelli's user avatar
1 vote
0 answers
185 views

SVM C vs gamma hyperparameter tuning

While running SVC(), how we can hyperparameter tune C vs gamma combination? I could see changes in C and gamma are impacting the accuracy differently. Also, what I understand about C and gamma are: C ...
SKB's user avatar
  • 554
1 vote
0 answers
26 views

Equivalent procedure to Scikit-Learns class_weight=balanced in Keras?

I want to train a SVM and a CNN with the same unbalanced multiclass-dataset and want to compare the results. I use Scikit-Learn for the SVM and Keras for the CNN. My goal is that no class is ...
Code Now's user avatar
  • 393
1 vote
0 answers
35 views

How to Manually Classify using SVM?

Consider points x1 = (1,1), x2=(1,0), x3=(1,-1) from class C1 and points x4 = (-1,1), x5=(-1-1) from class C2. Classify the given data with SVM How do we manually classify data by finding the ...
Man Dev's user avatar
  • 19
1 vote
0 answers
555 views

How to create an roc plot and calculate AUC for an svm (that does not return probabilities)?

I have some SVM classifier outputting final classifications for every sample in the test set, something like 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1 and so on. The "...
Gulzar's user avatar
  • 196
1 vote
0 answers
36 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 ...
Anh Tran's user avatar
  • 121
1 vote
2 answers
401 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 ...
Jan's user avatar
  • 139
1 vote
0 answers
153 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 ...
Piyush Raut's user avatar
1 vote
0 answers
18 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 ...
YCCCCC's user avatar
  • 121
1 vote
0 answers
57 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 ...
YCCCCC's user avatar
  • 121
1 vote
0 answers
403 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 ...
wizzo's user avatar
  • 11
1 vote
0 answers
64 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 ...
sunfishho's user avatar
  • 111
1 vote
1 answer
48 views

What is the best reference for multi-class SVM?

Can someone suggest some papers about the multi-classification methods by SVM? One against all? A good survey or paper which ...
sherek_66's user avatar
  • 155
1 vote
0 answers
174 views

Implementing SVM with Gaussian Kernel

This is referencing Prof. Andrew Ng's course on machine learning. In the part that details implementing an SVM with the Gaussian kernel, we are supposed to use all the training examples as our ...
Hrishikesh Athalye's user avatar
1 vote
1 answer
84 views

Get how similarity between the training data and the income data?

I'am trying to use Clustering and Classification methods as SVM using scikitlearn. I'm also studying some outliers/novelty detections I want something like a semi-supervised model. I want to predict ...
André Braga's user avatar
1 vote
0 answers
192 views

SVM/Naive Bayesian text classification on multiple features

I was building a text classifier which takes into account certain features of the text and classifies them into two - "Yes" or "No". I have trimmed the text, removed stopwords and have applied TFIDF ...
Jackdaw's user avatar
  • 111
1 vote
0 answers
24 views

Isolated/noisy instances that have outsized effect on SVM hyperplane selection

Consider two linearly separable classes and the optimal separating hyperplane (image credit Prof Jiawei Han of UIUC): Now consider if there were a single "rogue" point for the Yellow class - which ...
WestCoastProjects's user avatar
1 vote
0 answers
127 views

Combine AdaBoost and Support Vector Regression?

I have read several papers about using SVM instead of decision tree in AdaBoost, but I haven't seen any papers about using support vector regression (SVR) in AdaBoost. However, if using support vector ...
toantruong's user avatar
1 vote
0 answers
709 views

SVM hard and soft margins in matlab,

I am comparing the performances of several SVM models in matlab using the fitcsvm function, and I want to double check that I am using the correct syntax for hard ...
gin's user avatar
  • 341
1 vote
0 answers
28 views

Hyperparameter Tuning with Simulated Data

I'm trying to create a SVM classifier which can predict some fault, and to train it I'm using simulated examples of the fault. Of course, the simulations are not perfect, but they appear to be good ...
CanofDrink's user avatar
1 vote
1 answer
204 views

SVM radial basis generate equation for hyperplane

I need to generate an equation for hyperplane, I have two independent variables and one binary dependent variable. Regarding this following equation for svm , $f(x)=sgn( sum_i alpha_i K(sv_i,x) + b )$...
Alejandro 's user avatar
1 vote
0 answers
27 views

General way of constructing adjacency matrix in Laplacian SVM semi-supervised technique

I am trying to implement a Laplacian SVM classifier (trained in primal) using algorithm from this paper. I would like to know what is the most common way of constructing adjacency matrix and the most ...
Nicolas Scotto Di Perto's user avatar
1 vote
0 answers
19 views

How to choose the support vectors after minimizing the objective function?

I'm training a SVM that uses the following objective function: $$ \frac{1}{2}\sum_i{\sum_j{\alpha_i\alpha_j t_i t_j \mathcal{K}(\vec{x_i}, \vec{x_j})}} - \sum_i{\alpha_i} $$ The objective function ...
Hey's user avatar
  • 111
1 vote
0 answers
147 views

what is fuzzy svm?

I have to solve this question for my homework but I don't get how to formulate svm to FSVM. can someone please guide me? What is your idea to have a model of SVM classifier in which instances can ...
Hoda Fakharzadeh's user avatar
1 vote
0 answers
22 views

SVM Cost function change to improve its computational efficiency

While listening to Andrew Ng's course of Machine Learning he said that the SVM's cost function term $\frac{\Theta^T\Theta}{2}$ is usually changed to $\frac{\Theta^TM\Theta}{2}$, where matrix $M$ ...
daniels_pa's user avatar
1 vote
1 answer
923 views

test accuracy of text classification is too less

I have a data set of movies and their subtitles. My task is to classify them based on their ratings - [R, NR, PG, PG-13, G]. I have 13 examples for each class. I preprocessed the subtitles in the ...
Harshita Vemula's user avatar
1 vote
0 answers
42 views

Are there any good solutions for putting a radial basis kernel support vector machine into production?

Are there any good options for a radial basis kernel SVM where I can serialize the model to store and later deserialize and evaluate? I'm using ...
Jordan Bentley's user avatar