svm

What it mean by Training SVM

…衆ロ難τιáo~ 提交于 2019-12-08 10:05:03
问题 I am new to image processing.As my project i am doing "image classifier using SVM".I have the idea of my final software "I select some image and give it as input to my software and it will classify that image .if i give the image of an animal it will classify it to cat or snake suitably" When I google about it.it says "First you need to train SVM" What it mean by Training SVM? What is the actual input to SVM in my case (image classification)? SVM is just a classifier how it classify images.Is

SMO,Sequential Minimal Optimization in WEKA

ⅰ亾dé卋堺 提交于 2019-12-08 08:51:27
I'm new with Weka. I want to use Sequential Minimal Optimization in WEKA. Could anyone tell me how to proceed? here is my Java code but it doesn't work: public class SVMTest { public void test(File input) throws Exception{ File tmp = new File("tmp-file-duplicate-pairs.arff"); String path = input.getParent(); //tmp.deleteOnExit(); ////removeFeatures(input,tmp,useType,useNames, useActivities, useOccupation,useFriends,useMailAndSite,useLocations); Instances data = new weka.core.converters.ConverterUtils.DataSource(tmp.getAbsolutePath()).getDataSet(); data.setClassIndex(data.numAttributes() - 1);

SKLearn: Getting distance of each point from decision boundary?

倾然丶 夕夏残阳落幕 提交于 2019-12-08 08:07:31
问题 I am using SKLearn to run SVC on my data. from sklearn import svm svc = svm.SVC(kernel='linear', C=C).fit(X, y) I want to know how I can get the distance of each data point in X from the decision boundary? 回答1: For linear kernel, the decision boundary is y = w * x + b, the distance from point x to the decision boundary is y/||w||. y = svc.decision_function(x) w_norm = np.linalg.norm(svc.coef_) dist = y / w_norm For non-linear kernels, there is no way to get the absolute distance. But you can

Error with custom SVM model for tuning in caret

会有一股神秘感。 提交于 2019-12-08 07:08:45
问题 I'm trying to follow this link to create a custom SVM and run it through some cross-validations. My primary reason for this is to run Sigma, Cost and Epsilon parameters in my grid-search and the closest caret model (svmRadial) can only do two of those. When I attempt to run the code below, I get the following error all over the place at every iteration of my grid: Warning in eval(expr, envir, enclos) : model fit failed for Fold1.: sigma=0.2, C=2, epsilon=0.1 Error in if (!isS4(modelFit) & !

SVM with dynamic time warping kernel return error rate greater than 0

北城余情 提交于 2019-12-08 07:04:52
问题 I'm using Accord.net in my research. I have a vector sequences of variable size as input so I use DynamicTimeWarping as a kernel for MulticlassSupportVectorMachine. IKernel kernel = new DynamicTimeWarping(dimension); var machine = new MulticlassSupportVectorMachine(0, kernel, 2); // Create the Multi-class learning algorithm for the machine var teacher = new MulticlassSupportVectorLearning(machine, inputs.ToArray(), outputs.ToArray()); // Configure the learning algorithm to use SMO to train

Scikit - 3D feature array for SVM

时光毁灭记忆、已成空白 提交于 2019-12-08 07:04:42
问题 I am trying to train an SVM in scikit. I am following the example and tried to adjust it to my 3d feature vectors. I tried the example from the page http://scikit-learn.org/stable/modules/svm.html and it ran through. While bugfixing I came back to the tutorial setup and found this: X = [[0, 0], [1, 1],[2,2]] y = [0, 1,1] clf = svm.SVC() clf.fit(X, y) works while X = [[0, 0,0], [1, 1,1],[2,2,2]] y = [0, 1,1] clf = svm.SVC() clf.fit(X, y) fails with: ValueError: X.shape[1] = 2 should be equal

how's the input word2vec get fine-tuned when training CNN

情到浓时终转凉″ 提交于 2019-12-08 06:58:37
问题 When I read the paper "Convolutional Neural Networks for Sentence Classification"-Yoon Kim-New York University, I noticed that the paper implemented the "CNN-non-static" model--A model with pre-trained vectors from word2vec,and all words— including the unknown ones that are randomly initialized, and the pre-trained vectors are fine-tuned for each task . So I just do not understand how the pre-trained vectors are fine-tuned for each task. Cause as far as I know, the input vectors, which are

Why am I getting an empty matrix from svmpredict?

。_饼干妹妹 提交于 2019-12-08 04:32:34
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated 4 years ago . I want to make predictions from a simple time series. The observations y=[11,22,33,44,55,66,77,88,99,110] and at time x=[1,2,3,4,5,6,7,8,9,10] . I am using epsilon-SVR from libsvm toolbox. My code is as follows: x1 = (1:7)'; #' training set y1 = [11, 22, 33, 44, 55, 66, 77]'; #' observations from time series options = ' -s 3 -t 2 -c 100 -g 0.05 -p 0.0003 '; model = svmtrain(y1,

Error with custom SVM model for tuning in caret

不羁的心 提交于 2019-12-08 04:28:28
I'm trying to follow this link to create a custom SVM and run it through some cross-validations. My primary reason for this is to run Sigma, Cost and Epsilon parameters in my grid-search and the closest caret model (svmRadial) can only do two of those. When I attempt to run the code below, I get the following error all over the place at every iteration of my grid: Warning in eval(expr, envir, enclos) : model fit failed for Fold1.: sigma=0.2, C=2, epsilon=0.1 Error in if (!isS4(modelFit) & !(method$label %in% c("Ensemble Partial Least Squares Regression", : argument is of length zero Even when

Is there a way to use recursive feature selection with non linear models with scikit-learn?

允我心安 提交于 2019-12-08 03:53:00
问题 I am trying to use SVR with an rbf kernel (obviously) on a regression problem. My dataset has something like 300 features. I would like to select more relevant features and use something like the sequentialfs function of matlab which would try every combination (or anyway starting with few variables and adding variables on the way, or the opposite, going backward, like the RFE or RFECV of scikit)). Now, as said, for python there is the RFE but I can't use it with a non linear estimator. Is