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
1answer
13 views

Support Vector Classifier and cost C

Applying SVC (Support Vector Classifier) to the 1-d data shown here: What will be the support vectors for the parameter cost C=0 and C=Infinity? As far as I read about SVM and hyper parameter C I ...
0
votes
0answers
17 views

Problem in working out an example of SVM: mathematical steps

I am trying to code SVM from scratch using a small toy problem that involves five support vector values. In the code below, there are 5 support vectors arbitrary chosen and denoted by the variables <...
1
vote
1answer
23 views

Why is the optimal C chosen by GridSearchCV so small?

I'm trying to use GridSearchCV to select the optimal C value in this simple SVM problem with non-separable samples. The issue I'm having is that when I run the code the optimal C is chosen to be ...
1
vote
1answer
21 views

Need help understanding Hard SVM quadratic program equation

This is from the textbook "Understanding Machine Learning" by Shalev-Schwarz p. 169. Can anyone help me understand why the solutions to this optimization problem need to be divided by the ...
0
votes
1answer
16 views

Steps to fit a Machine learning model for prediction of up and down market movement

I have around 5 years of data of an index containing many features on a daily basis. I want to classify whether the index will move up or down the next trading day (up or down movement is determined ...
0
votes
0answers
8 views

Classification with disjoint boxes

Are there any classification schemes like a support vector machine that use axis-aligned boxes instead of hyperplanes? I have a dataset consisting of about a billion points in 9 dimensions, which are ...
1
vote
0answers
15 views

Finding the dual to an optimization problem on an unsupervised dataset [closed]

We consider the unsupervised dataset $x_1,..x_N \in R^d$ and the optimization problem: $$min_w \,\frac{1}{2}{\left\lVert w \right\rVert}^2,$$ subject to constraints:$$\forall_{i=1}^N: \phi(x_i)^Tw\...
0
votes
0answers
19 views

Results of quadratic SVM in Matlab are different from the results obtained in Python

I am trying to replicate a quadratic SVM classifier from Matlab to Python, however I am having different results regarding the accuracy. In Matlab the accuracy is 0.8955 meanwhile in Python the ...
0
votes
1answer
41 views

How important is outcome variable scaling in SVM regression?

Should I scale outcome variable for SVM regression? What is the magnitude of impact of outcome variable scaling in SVM regression?
-2
votes
3answers
51 views

How to decrease $R^2$ value and change it to positive value [closed]

I'm working on a data, and use regression , as you see bellow: from sklearn.svm import SVR regressor = SVR(kernel = 'linear') regressor.fit(trainX,trainY) above ...
1
vote
0answers
12 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 ...
3
votes
2answers
110 views

Preprocessing: StandardScaler() Do we really need mean to be zero?

For instance, many elements used in the objective function of a learning algorithm (such as the RBF kernel of Support Vector Machines or the l1 and l2 regularizers of linear models) assume that all ...
0
votes
0answers
42 views

Confusion matrix : Train data accuracy lower than test data accuracy and 95%CI meaning

Let's say that I have training data and test data. I trained the model with the training data and then constructed a confusion matrix of the predictions of both. I am getting that the prediction of ...
1
vote
1answer
59 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 ...
3
votes
2answers
63 views

Understanding Learning Curves

I would like to clarify my understanding of learning curves with two example plots below. I am experimenting with small data sets here between 500 and 1500 samples to clarify my understanding. My ...
2
votes
2answers
38 views

One-Class classification

I am currently using an one class classification svm and I am trying to boost the classification results by employing more than one svm-occ with varying gamma parameters and combine these decisions ...
0
votes
1answer
41 views

Why does using a standard scalar on my tf idf matrix make it perform better?

I have a tf-idf matrix transformed on a list of tweets from a data set i am using. I have a pipeline where i initiate a StandardScalar and then next have my SVM with a linear kernel and auto gamma as ...
2
votes
0answers
45 views

Intuition behind One Class SVM (Scholkopf)

I am trying to understand the intuition behind the idea of finding a hyperplane that separates the training data from the origin in the feature space. Why separation from origin with a hyperplane ...
0
votes
0answers
38 views

Overfitting in imbalanced dataset

I am working on a dataset related to an insurance company and the objective is to predict if the insurance buyer will claim their travel insurance or not. Training data: https://raw.githubusercontent....
1
vote
0answers
20 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 ...
1
vote
2answers
58 views

How plot GridSearch results?

I trained an SVM model with GridSearch ...
0
votes
0answers
340 views

UserWarning: No contour levels were found within the data range

I am running the exact example give in this SVM example of Scikit learn without any modification. I get the following warning. ...
0
votes
1answer
67 views

How to find the initial hyperplane in a Support Vector Machine (SVM)?

As far as I understand Support Vector machines, we are trying to find the optimal hyperplane, out of all hyperplanes that are equidistant from the support vectors. There are an infinite number of ...
1
vote
1answer
80 views

Support Vector Machines (SVM) vs Minimum distance between two convex hulls [closed]

Imagine that we have two sets of seperable points, X and Y, in the plane (R^2) that we want to classify. To find the optimal line (hyperplane) that separates these two sets of points we can: Run a ...
0
votes
0answers
29 views

SVM overfitting with consistent validation results

I have some imbalanced (1400 samples of which 250 are +ve) data for a binary classification problem and I am running an SVM grid search optimising for precision. I am trying 3,4,5,6,7,and 8 stratified ...
1
vote
0answers
29 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 ...
0
votes
1answer
21 views

Why multi-class SVM can't detect some classes?

I use PCA and multi-class SVM for classifying 4-class problem in the Python environment. But in results, I see some differences in detection rate (Unweighted Accuracy in this problem). For example: ...
0
votes
0answers
30 views

Existing library or code for - SVM as classifier in the last layer of neural network/deeplearning

I have read many articles which replaced cross-entropy or softmax layer with SVM classifier in neural network. Their results suggested SVM-NN (SVM as classifier) outperformed softmax, cross-entropy. (...
2
votes
0answers
16 views

Non semi positive definite kernel matrix

What happens if we run a support vector machine model using a kernel that does not satisfy requirements such as non-positive semi definite? This is my flow of thought: In kernel methods $w.x$ is ...
1
vote
1answer
76 views

SVM - Making sense of distance derivation

I am studying the math behind SVM. The following question is about a small but important detail during the SVM derivation. The question Why the distance between the hyperplane $w*x+b=0$ and data ...
1
vote
0answers
75 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 ...
1
vote
2answers
59 views

How much data do you need to build a classifier?

I would like to ask you what a good size of dataset would be for building a classifier. I know that there are datasets of 1000 obs and datasets of 1m obs. But I also read papers where classifiers were ...
1
vote
0answers
33 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 ...
0
votes
0answers
23 views

Continue with LSTM or try other approaches?

I am trying to predict error (deviation from the actual behavior) in a signal, here is an example Blue -> Reference/Actual signal (cannot be fed to the network, used to calculate error only) Orange ...
0
votes
0answers
24 views

How to tune gamma for one class SVM?

I have 2 set of numbers: one big (300.000+ numbers) and one little (50- numbers). Assuming that the elements of the little one form a cluster I want to identify the elements of the big one that belong ...
1
vote
2answers
7k views

ValueError: y should be a 1d array, got an array of shape (285, 30) instead [closed]

I am using this data set below and I am trying to find the support vector machine of the data set. Also I have my code and error below as well. http://scikit-learn.org/stable/modules/generated/sklearn....
0
votes
1answer
30 views

GridSearchCV Acting Weird

I am using GridSearchCV to find the best combination of parameters for SVM. However, the parameters chosen by GridSeasrchCV do not seem to be the best ones. I tried some parameters randomly and they ...
1
vote
1answer
52 views

Is Recursive Feature Elimination finding best features subset?

On a set of 9 features I have applied Recursive Feature Elimination (RFE) algorithm using SVM estimator, following approach from (1). When requesting a subset of size 1 to be found, then RFE returned ...
0
votes
0answers
316 views

ValueError: bad input shape

I have multilabel problem. I was using onevsrestclassifier and now i want to use onevsoneclassifier. ...
0
votes
3answers
245 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
0answers
44 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
1answer
34 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
1answer
1k views

GridSearchCV() to fine tune outputs ValueError and FitFailedWarning

I want to fine tune some parameters for my linear SVM. This is the code: ...
0
votes
1answer
16 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
1answer
29 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: ...
0
votes
0answers
225 views

SVM is taking too long for hyperparameter tuning

I am running SVM,Logistic Rregression and Random Forest on the credit card dataset. My training dataset has the shape (454491, 30). I performed 5-fold cross validation(which took more than an hour) ...
1
vote
1answer
93 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
1answer
44 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 ...

1
2 3 4 5
10