svm

implementing Bags of Words object recognition using VLFEAT

你离开我真会死。 提交于 2019-12-12 08:59:44
问题 I am trying to implement a BOW object recognition code in matlab. The process is slightly complicated and I've had a lot of trouble finding proper documentation on the procedure. So could someone double check if my plan below makes sense? I'm using the VLSIFT library extensively here Training: 1. Extract SIFT image descriptor with VLSIFT 2. Quantize the descriptors with k-means(vl_hikmeans) 3. Take quantized descriptors and create histogram(VL_HIKMEANSHIST) 4. Create SVM from histograms(VL

Building SVM with tensorflow's LinearClassifier and Panda's Dataframes

坚强是说给别人听的谎言 提交于 2019-12-12 08:57:08
问题 I'm aware of this question, but it is for an outdated function. Let's say I'm trying to predict whether a person will visit country 'X' given the countries they have already visited and their income. I have a training data set in a pandas DataFrame that's in the following format. Each row represents a different person, each unrelated to the others in matrix. The first 10 columns are all names of countries and the values in the column are binary (1 if they have visited that country or 0 if

How to Setup LIBSVM for Python

六眼飞鱼酱① 提交于 2019-12-12 08:35:13
问题 I built libsvm on Mac OS X with Make. $ tar xzfv libsvm-3.17.tar.gz $ cd libsvm-3.17 $ make This built the various libsvm binaries: $ ls COPYRIGHT heart_scale svm-predict.c svm-train.c tools FAQ.html java svm-scale svm.cpp windows Makefile matlab svm-scale.c svm.def Makefile.win python svm-toy svm.h README svm-predict svm-train svm.o I also linked to this in /usr/local : $ ls -la /usr/local/ ... svm -> /usr/local/libsvm-3.17/ And appended the Python bindings to my path: import sys sys.path

Supprt Vector Machine works in matlab, doesn't work in c++

六眼飞鱼酱① 提交于 2019-12-12 07:24:16
问题 I'm writing an application that uses an SVM to do classification on some images (specifically these). My Matlab implementation works really well. Using a SIFT bag-of-words approach, I'm able to get near 100% accuracy with a linear kernel. I need to implement this in C++ for speed/portability reasons, and so I've tried using both libsvm and dlib. I've tried multiple SVM types (c_svm, nu_svm, one_class) and multiple kernels (linear, polynomial, rbf). The best I've been able to achieve is around

C# ENCOG SVM classification with my own dataset

只愿长相守 提交于 2019-12-12 06:38:26
问题 I would like to do a multiclass classification application in C#. I decided to use encog to do so. Now I am stuck at one point. I found a XOR example, which I understand. But when I am going to use my own dataset, app is computing only with one feature from one example. Here is my code: namespace ConsoleApplication1 { public static class Load { public static double[][] FromFile(string path) { var rows = new List<double[]>(); foreach (var line in File.ReadAllLines(path)) { rows.Add(line.Split

SVM prediction does not predict OK although the support vectors are valid

限于喜欢 提交于 2019-12-12 05:48:56
问题 I have a following( fig 1 ) unlabeled training set which I am trying to detect the outliers, have come up with a procedure to label the data with 0:normal data and 1:outlier and want to train it with SVM. I followed this instructions to train the SVM's model but when I am trying to predict the labels of same data I have trained the SVM it does not predict any( fig 2 )! fig 1: the support vectors after training fig 2: the prediction of SVM model on the same data it has been training with The

Opencv 3.0 SVM train classification issues

可紊 提交于 2019-12-12 05:25:17
问题 Im new in openCV SVM. Im running in Xcode 7.0, openCV 3.0, Below is my code MatMat labels(0,1,CV_32FC1); //Mat labels(0,1,CV_32S); //I also try this when i saw some posting, But error too. ... Mat samples_32f; samples.convertTo(samples_32f, CV_32F); //Mat samples_32f; samples.convertTo(samples_32f, CV_32FC1); //tried! Ptr<SVM> classifier = SVM::create(); classifier->SVM::train(samples_32f, 0, labels); <- Here the Error The OpenCV Error: Bad argument (in the case of classification problem the

ValueError: labels ['timestamp'] not contained in axis

 ̄綄美尐妖づ 提交于 2019-12-12 05:09:00
问题 I am learning machine learning and I came across this code. I am trying to run the file "Recommender-Systems.py" from the above source. But it throws an error ValueError: labels ['timestamp'] not contained in axis. How can it be removed? Here's a dropbox link of u.data file. 回答1: Your data is missing the headers so it's being wrongly inferred by the first row. You need to change a little bit the Recommender-Systems.py and manually inform the headers. The right header is available in the

Write custom kernel for svm in R

对着背影说爱祢 提交于 2019-12-12 04:35:13
问题 I'm looking to use the svm() function of the e1071 package in R. I am new to this package and I was wondering if it is possible to write your own custom kernel callable in svm(). I see that there are several kernels pre-loaded, but I don't see a cosine similarity kernel, which is what I need. Alternatively, is there another package in R allowing you to run SVM with cosine similarity kernel? 回答1: The bad news is it is currently not supported in e1071. There was a discussion many years ago

Sklearn SGDC partial_fit ValueError: classes should include all valid labels that can be in y

爷,独闯天下 提交于 2019-12-12 04:01:51
问题 loaded already trained SGDC model and tried to again partial_fit with new features set and data. but received ValueError: classes should include all valid labels that can be in y and my class_weights = None and wanted to have each class equal weights. model_predicted_networktype = joblib.load(f) new_training_data_count_matrix =count_vect_predicted_networktype.transform(training_dataset) new_training_tf_idf = tf_idf(new_training_data_count_matrix) model_predicted_networktype.partial_fit(new