svm

Multi-class classification using LIBLINEAR

独自空忆成欢 提交于 2019-12-11 17:49:50
问题 I am a beginner to SVM which i have successfully implemented one-class classification.Now i want to know about multi-class classification which am very much confused about. I went through How to do multi class classification using Support Vector Machines (SVM) which i want the exact same output but the link does not have a specific example using windows.If anyone can help me out with an example in windows for both “ONE-AGAINST-ONE”,”ONE-AGAINST-ALL” methods of multi-class classification

Using SVM with HOG Features to Classify Vehicles

自作多情 提交于 2019-12-11 15:48:09
问题 My goal here is to classify between SUVs and sedans using SVMs and HOG features. First I read 86 training images, calculate the HOG features for each of them, and put them in a training Mat that is of size 86xdescriptorSize called HOGFeat_train. Mat HOGFeat_train(num_train_images, derSize, CV_32FC1); //86xdescriptor size training Mat for (int file_count = 1; file_count < (num_train_images + 1); file_count++) { ss << name << file_count << type; //'Vehicle_1.jpg' ... 'Vehicle_2.jpg' ... etc ...

ValueError: X.shape[1] = 1 should be equal to 14, the number of features at training time

风流意气都作罢 提交于 2019-12-11 15:38:02
问题 I am trying to predict boston housingdata by using SVR and I am using the following code but getting some error. # -*- coding: utf-8 -*- import sys import pandas as pd columns=['ID','crim','zn','indus','chas','nox','rm','age','dis','rad','tax','ptratio','black','lstat','medv'] dataset_train=pd.read_csv('train.csv')#,names=columns) train_y=pd.DataFrame(dataset_train.medv) dataset_train=dataset_train.drop('medv',axis=1) columns_test=['ID','crim','zn','indus','chas','nox','rm','age','dis','rad',

python svm function with huber loss

假装没事ソ 提交于 2019-12-11 15:30:10
问题 I need a svm classifier of python with huber loss function. But its default loss function is hinge loss. Do you know how can I assign loss function to python svm? svc = svm.SVC(kernel='linear', C=1, gamma=1).fit(data, label) 回答1: There is really no such thing as "SVM with huber loss", as SVM is literally a linear (or kernelized) model trained with hinge loss. If you change the loss - it stops being SVM. Consequently libraries do not have a loss parameter, as changing it does not apply to the

How would phi of the gaussian rbf kernel map a 100-by-3 dimensional feature matrix?

点点圈 提交于 2019-12-11 14:30:05
问题 Would a 100-by-3 dimensional feature matrix be mapped into a 100 dimensional or into a infinite dimensional feature space, if the mapping would not be bypassed by the Gaussian RBF Kernel? Following this reasoning (The RBF kernel of Support Vector Machine) I would tend to say the feature matrix would be mapped to a inifinite dimensional feature space. Here a summary of the content: Given a m-by-n feature matrix X . Each n-dimensional instance x of X is used to define a n-dimensional normal

How to predict all classes in a multi class Sentiment Analysis problem using SVM?

房东的猫 提交于 2019-12-11 13:00:59
问题 Well, I am making a sentiment analysis classifier and I have three classes/labels, positive, neutral and negative. The Shape of my training data is (14640, 15), where negative 9178 neutral 3099 positive 2363 I have pre-processed the data to make it standardized and applied the bag-of-words word vectorization technique to the text of twitter for making it feedable to the model, whose size is then (14640, 1000). As the Y, means the label is in the text form so, I applied LabelEncoder so that I

people detection with haar cascade

好久不见. 提交于 2019-12-11 12:26:07
问题 I am working on a project in my school to detect how many students are in the classroom. Like in this picture. I have been trying to use Haar Cascade in opencv for face detection to detect people, but the result is very bad. Like this: I took thousands of pictures in classroom, and cropped the picture with people manually. There are about 4000 positive samples and 12000 negative samples. I was wondering what did I do wrong? When I crop the image, should I only crop only head like this? Or

Why is my Spark SVM always predicting the same label?

我怕爱的太早我们不能终老 提交于 2019-12-11 12:23:17
问题 I'm having trouble getting my SVM to predict 0's and 1's where I would expect it to. It seems that after I train it and give it more data, it always wants to predict a 1 or a 0, but it will predict all 1's or all 0's, and never a mix of the two. I'm wondering if one of you could tell me what I'm doing wrong. I've searched for "svm always predicting same value" and similar problems, and it looks like this is pretty common for those of us new to machine learning. I'm afraid though that I don't

SVM for one Vs all acoustic signal classification

╄→尐↘猪︶ㄣ 提交于 2019-12-11 12:09:40
问题 My aim is to classify an impulsive audio signal as whether it is a gunshot or not a gunshot. I am trying to detect the gunshot event in MATLAB using svmtrain and svmclassify functions. To evaluate the accuracy of classification, the balloon burst and clapping signal are used as different classes. While accuracy of differnetiating between gunshot and either of the two classes is good, the differentiation between gunshot and combined baloon+clap signal is poor. Please guide how may I use SVM to

Support Vector Machine Primal Form Implementation

十年热恋 提交于 2019-12-11 10:57:34
问题 I am currently working on a support vector machine (SVM) project. The version of SVM that I am working on is Linear SVM in Primal Form and I am having hard time understanding where to start. In general, I think I understand the theory; basically I need to minimize norm of w under certain constraint. And the Lagrangian function will be my objective function to be minimized (after Lagrange multiplier is applied). The things that I don't understand is that I was told from my professor that we