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.

svm
Filter by
Sorted by
Tagged with
0 votes
1 answer
81 views

using SMV 'ovo' with RandomUnderSampler

I am doing classification with imbalanced dataset. I understand sklearn's SVM does have a decision_function_shape hyperparameter which can be set to 'ovo' for 'one against one' (although SVM does an '...
user avatar
0 votes
1 answer
45 views

SVM in RStudio cannot predict input from the user

I have created a SVM in R and it runs successfully when I predict one of the rows from the original dataset Example: Let's say I use the first row of dataset model <- readRDS("...
ryoshi007's user avatar
-1 votes
1 answer
36 views

After normalising my data using DataPreparer while using random forest and SVM, why do my data values become negative?

I am working on predictive modeling where I need to predict whether an online customer ends up purchasing a product on a website or not, and I am using Random Forest Classifier and SVM since it's a ...
Eri Bytyci's user avatar
4 votes
2 answers
1k views

Different approaches for applying SVM in Keras

I want to build a multi-class classification model using Keras. My data is containing 7 features and 4 labels. If I am using Keras I have seen two ways to apply the Support vector Machine (SVM) ...
Alwani's user avatar
  • 125
1 vote
0 answers
468 views

Getting 100% accuracy on SVM classifier, tried everything, still 100% accuracy, is my model behaving correctly?

I have a small sample size (~150) and 35 features. I intend to classify based on the response variable (nearly 50:50 TRUE:FALSE) and I chose SVM classifier as my model. Checked for duplicates in my X ...
Curious_turtle's user avatar
-1 votes
1 answer
42 views

Svm Multi-Classification in R

I am using the SVM model for the classification of the data given below, but I don't know why I am getting this error. I have tried using two methods but both are not working. Please help me I am ...
M. Talha Bin Asif's user avatar
1 vote
0 answers
282 views

What is the best way to plot 30 dimensional SVM output in R?

I'm trying to apply a non-linear SVM, to separate my data (~30 features to predict disease (0 = no PH, 1= PH) in ~100 patients). I've been testing lots of different kernels, gamma values and cost ...
Ellie Desmond's user avatar
1 vote
0 answers
170 views

What does an empty VIP plot mean with the vip package in r?

I am trying to plot variable importance from a support vector model using the vip package in R. However, the plot is empty. set.seed(2022) pet_uv_raw_svm_fit %>% extract_fit_parsnip() %>% vip(...
Sukis's user avatar
  • 13
0 votes
1 answer
272 views

Centering of numpy image

I want to make an artificial intelligence application that predicts a handwritten number drawn on a canvas based on the MNIST dataset and prints it on the screen. Almost everything is ready for this. ...
SalwoX's user avatar
  • 1
1 vote
0 answers
99 views

Easy way to plot basic SVM in python?

I have the following code which creates some random points and a basic polynomial kernel SVM. It then plots just the points. I want to add the decision boundary/margin to the plot. Any and all input ...
stone327's user avatar
0 votes
1 answer
65 views

'int' object is not subscriptable : HOG SVM object detection in Python

I'm working on an object detection project, while using HOG skimage and SVM. I'm trying to save all my positive windows in a list using my SVM model that I trained, but I'm facing an error : 'int' ...
Dilow's user avatar
  • 35
0 votes
1 answer
692 views

What is the equation for SVR inference using an RBF kernel?

I'm using sklearn for SVR (regression) using an RBF kernel. I'm want to know how the inference is done under the hood. I thought it was a function of the support vectors, function mean, and gamma, ...
Tony Liechty's user avatar
0 votes
0 answers
135 views

I have no idea how to input images into SVR sklearn, convert to numpy array?

I'm trying to do Support Vector Regression using images on x column and value (float) on y column. Through error code 'could not convert string to float: '/content/gdrive/MyDrive/Test1/DATA/SATURATION/...
Tartarus's user avatar
0 votes
1 answer
183 views

How do I do GridSearchCV() on svm.SVR()?

Say I have param_grid = { "C": [1, 2, 3, 4] "gamma": [0.1, 0.001, 0.0001, 1] "kernel": ["rbf", "linear", "poly", "...
Anonymous's user avatar
0 votes
1 answer
54 views

Text file classification in r from KNN to SVM

my problem is that i don't understand how to go to SVM, actually i have 20% mistakes in KNN so i want to improve this stat, i work on html files that i put in a VCorpus, clean, put in a DTM, figure ...
Thechrome37's user avatar
1 vote
0 answers
35 views

Tuning of SVM Text Classifier created with RTextTools returns same performance for every hyperparameter

I have created a text classifier with RTextTools, but it does not perform that good. That is why I decided to tune the parameters gamma and c to improve the models' performance with the following code:...
Jan's user avatar
  • 11
0 votes
1 answer
168 views

SVM classifier n_samples, n_splits problem sklearn Python

I'm trying to predict volatility one step ahead with an SVM model based on O'Reilly book example (Machine Learning for Financial Risk Management with Python). When I copy exactly the example (with S&...
MARIO ANTONIO CASTILLO MACHUCA's user avatar
2 votes
1 answer
618 views

Scikit-learn BaggingRegressor with SVR fast to train but slow to predict

I see a number of questions about SVM speed, but nothing about the difference between training and prediction. Here is the code for the model in question: from sklearn.svm import SVR from sklearn....
SuperCodeBrah's user avatar
-1 votes
3 answers
4k views

Why is the model getting 100% accuracy for SVM, Random-forest Classifier and Logistic Regression?

I'm using an existing disease prediction model to build a chatbot. While I was referring to the model I realized that it has an accuracy of 100%. I'm not quite sure how and why the accuracy is 100%. I'...
Vins98's user avatar
  • 61
1 vote
1 answer
318 views

How to reshape this kind of data and train it by using SVM?

Sample data here https://drive.google.com/file/d/1ngjFNALjzMqLknPsq5cgG4JbchwzVrjo/view?usp=sharing My data have 1024x1776 column. This is my code # Importing the libraries import numpy as np ...
Koh Kheng Hong's user avatar
3 votes
1 answer
17k views

ValueError: X has 1 features, but SVC is expecting 3 features as input

I am trying to create a stock price predictor (not to actually use it to invest don't worry) using Keras and sklearn, which grabs any of the time series from Kaggle and checks the "Close". ...
Nightingale's user avatar
0 votes
1 answer
43 views

SVM formulations using sedumi

As I am new to Sedumi modeling framework, would like to get help in writing SVM model formulations (binary or multiclass) in Sedumi. I have tried in CVXPY which is in python, but wanted to have it in ...
Sree's user avatar
  • 81
1 vote
1 answer
841 views

Cosine similarity and SVC using scikit-learn

I am trying to utilize the cosine similarity kernel to text classification with SVM with a raw dataset of 1000 words: # Libraries import numpy as np from sklearn.svm import SVC from sklearn....
ukmz75's user avatar
  • 29
0 votes
0 answers
84 views

Python Sklearn: My project svm.SVC output error

enter image description here info: use jupyter notbook use sklearn.svm error output fit mycode: from sklearn import svm model = svm.SVC() model.fit(X_train, y_train) -- Console output: [SVC()]
AZULE _'s user avatar
0 votes
1 answer
129 views

Can I get the feature importance of test data through the svm model?

I built the svm model through learning data and scikitlearn. The data consists of about 1000 pieces, and the feature consists of 50. What I'm curious about is that when predicting new data through ...
황준석's user avatar
0 votes
0 answers
268 views

Histogram Intersection Kernel

I want to calculate and use a histogram intersection kernel for a text classsification problem with SVM. I'm using bag of n-grams with CountVectorizer(). Does anyone know how to do it? # Libraries ...
ukmz75's user avatar
  • 29
0 votes
1 answer
230 views

"Model is empty! error using tune for svm method in package e1071

I'm trying to tune hyperparameters epsilon and cost using the tune function in e1071, but I keep getting this error whenever I try to expand the ranges of values that I want to test: "Error in ...
Antonio Robelo's user avatar
1 vote
1 answer
126 views

SVM doesn't plot in R

I'm doing predictive analytics on R, and I executed a plot command with neither an error message nor an output. I'll reproduce my code from a stroke dataset. stroke <- read.csv('healthcare-dataset-...
E_Sarousi's user avatar
  • 185
0 votes
2 answers
323 views

SVM classifier giving wrong predictions for MNIST images

I'm using SVM to predict the values in MNIST dataset. The accuracy of the model comes close to 91% but when I use it along with open cv to predict the value of an image, the result always shows 0. ...
Esjee's user avatar
  • 25
1 vote
1 answer
39 views

Getting Name of Images at which SVM mispredicted

I am working on a Binary Classification Model and i want to know the names of the Images that the model mispredicted .How can i do this ? to_be_moved = random.sample(glob.glob("/content/COVID-...
FreeCourse's user avatar
0 votes
2 answers
174 views

SVM Classifier runs endlessly

I'm trying to run a SVM classifier but it runs endlessly, its been 6 hours now and it's still running. This is the code import numpy as np from sklearn import preprocessing, model_selection, neighbors,...
DeeVoo's user avatar
  • 1
-1 votes
1 answer
519 views

Support Vector Regression (SVR) Time series

I am trying to use SVR in python for a monthly time series. My training data is from january 2019 to June 2021 and my testing from july 2021 to December 2021. I am trying to predict the sales using ...
MIGB91's user avatar
  • 13
0 votes
2 answers
438 views

How to get the support vectors when using LinearSVC?

I am using GridSearchCV and would like to save the support vectors as follows: np.save("support_vectors.npy", gs_cv.best_estimator_.named_steps['svm'].support_vectors_) But I get this error:...
Caterina's user avatar
  • 935
0 votes
1 answer
120 views

selecting data points neighbourhood to support vectors

I have been thinking of this but not sure how to do it. I have a binary imbalanced data, and would like to use svm to select just subset of the majority data points nearest to support vector. ...
user avatar
0 votes
0 answers
518 views

How to combine SVM and KNN?

This is SVM code import numpy as np from sklearn.model_selection import train_test_split from sklearn.svm import SVC import joblib from sklearn.metrics import accuracy_score from sklearn.metrics ...
Piumi Maheshika's user avatar
0 votes
1 answer
39 views

I want to know the importance of features used in the test set in the svm model

I made a binary classification svm model through sklearn.svc This is my SVC model info. SVC(C=0.1, class_weight={0: 1.2306547619047619, 1: 0.8421588594704684}, gamma=0.001, probability=True) What ...
황준석's user avatar
1 vote
2 answers
4k views

ValueError: not enough values to unpack (expected 4, got 1), on a dictionary

I tried searching for the answer, but I dont know why it is expecting 4...so I can't find the solution. I am trying to make a script that will iterate over the models and then create a plot based on ...
Francesca C's user avatar
1 vote
0 answers
106 views

How can I use an SVM to seperate two classes in a 2D map?

I have 2d-numpy array of points defining a map with obstacles Image of the 2D Map of which I am trying to create an SVM with. The values of this 2d-array are either 0 for open space (grey) or 1,-1 for ...
p1unge's user avatar
  • 53
0 votes
1 answer
46 views

Undo pushed commits of a specific file without affecting commits after that

I have made a commit which I need to undo. A - B - C - D I need to undo commit B without affecting commits after it (C and D). Also there are changes in 2 files (File X and File Y)in commit B. Of ...
Husain Amjherawala's user avatar
1 vote
1 answer
65 views

how do i fill the plt.scatter parameter for svm visualization

I'm currently building my SVM model, I'm new to ML and have been building my model just by looking at the tutorial here and there. I have a problem at data visualization. This is the reference that I ...
hanaganesa's user avatar
1 vote
0 answers
20 views

Which algorithm is the best based on P-Values

I used the following code: plt.figure(figsize = (7, 7)) plt.boxplot([totalP['poly'], totalP['rbf'], totalP['linear'], totalP['gf']]) plt.xticks(np.arange(1, 5), kernels) plt.title('P values for each ...
user2537224's user avatar
1 vote
0 answers
71 views

Is it possible to check the progress of running e1071::svm function in R

I am running machine learning approaches with a quite large training set (df of 110000x14). All of the models, that I build have satisfying runtime but SVM with radial kernel from 'e1071' library ...
Олег's user avatar
0 votes
1 answer
759 views

sklearn.SVR using multiple features

I've been away from sklearn for a while, and evidently forgot something key (and likely simple). I want to fit a dataset of 6696 samples and four features: X.shape is (6696,1) and y.shape is (6696, 4)...
fearless_fool's user avatar
0 votes
1 answer
2k views

Can the f1, precision, accuracy and recall all have the same values?

I've been trying to implement a support vector machine algorithm using scikit-learn and after doing some measurements all the scores provide the same values. x = df["Text"] y = df["Mood&...
Chiby's user avatar
  • 7
1 vote
0 answers
256 views

When to use OneVsRestClassifier?

If the decision function of svm.SVC is by default "ovr", why would we use OneVsRestClassifier(svm.SVC(kernel="linear") instead of just svm.SVC(kernel="linear")?
Caterina's user avatar
  • 935
0 votes
1 answer
786 views

How to select the optimal probability threshold for classifiers in R?

I am creating a binary classifier in R, but I don't know what probability threshold to select for class separation. The code is as follows: tune.out <- tune(svm, X0 ~ ., data = data....
A Jorg's user avatar
  • 161
1 vote
1 answer
2k views

ValueError: multiclass format is not supported on ROC_Curve for text classification

I am trying to use ROC for evaluating my emotion text classifier model This is my code for the ROC : # ROC-AUC Curve from sklearn.metrics import roc_curve, auc import matplotlib.pyplot as plt fpr, tpr,...
Ronald Ferdinand's user avatar
0 votes
1 answer
124 views

Warning message: In method$prob(modelFit =modelFit, newdata =newdata, submodels =param) : kernlab class probability calculations failed; returning NAs

I'm getting the following error above which seems to be related to the caret package. I have checked my data and don't have any NA values as they were all removed in the cleaning stages. I'm trying ...
Fiona Doughan's user avatar
0 votes
0 answers
130 views

SVM are giving Weird Results on Chest X Rays

I am working on a Machine Learning Project for identifying Covid 19 from Chest X Rays . I use this data set from kaggle https://www.kaggle.com/datasets/prashant268/chest-xray-covid19-pneumonia ...
AfifK's user avatar
  • 36
0 votes
1 answer
61 views

Fitting SVC model on Khan Gene Data Set in Python

I have four .csv files containing the training data (data points and their classes) plus test data (data points and their classes) that has been stored into X_train, y_train, X_test and y_test ...
Naser.Sadeghi's user avatar

1
3 4
5
6 7
91