svm

How to disable the console output in libsvm (java)

心已入冬 提交于 2019-12-11 01:59:19
问题 I am using libsvm in java and am experiencing similar issues as described here for python. I am getting a lot of console output during training and prediction and would like to disable it. Sadly, due to a "Service Temporary Unavaiable" I can't access the website, where it might be described (here). I couldn't find a java related way to disable this warnings (If I did oversee something I apologize) The Output always looks quite similar to this: optimization finished, #iter = 10000000 nu = 0

GridSearchCV - access to predicted values across tests?

ぐ巨炮叔叔 提交于 2019-12-11 00:24:07
问题 Is there a way to get access to the predicted values calculated within a GridSearchCV process? I'd like to be able to plot the predicted y values against their actual values (from the test/validation set). Once the grid search is complete, I can fit it against some other data using ypred = grid.predict(xv) but I'd like to be able to plot the values calculated during the grid search. Maybe there's a way of saving the points as a pandas dataframe? from sklearn.preprocessing import

R: SVM performance using custom kernel (user defined kernel) is not working in kernlab

半世苍凉 提交于 2019-12-10 20:23:49
问题 I'm trying to use user defined kernel. I know that kernlab offer user defined kernel(custom kernel functions) in R. I used data spam including package kernlab. (number of variables=57 number of examples =4061) I'm defined kernel's form, kp=function(d,e){ as=v*d bs=v*e cs=as-bs cs=as.matrix(cs) exp(-(norm(cs,"F")^2)/2) } class(kp)="kernel" It is the transformed kernel for gaussian kernel, where v is the continuously changed values that are inverse of standard deviation vector about each

Use of OneClassSVM with GridSearchCV

眉间皱痕 提交于 2019-12-10 19:49:40
问题 I am trying to perform a GridSearchCV function on OneClassSVM, but I can't seem to find right scoring method for OCSVM. From what i've gathered something like OneClassSVM.score does not exists thus is doesn't have a default scoring function needed in GridSearchCV. Unfortunately no scoring methods from the documentation doesn't work either because they are dedicated to supervised ML and OCSVM is a unsupervised method. Is there any way to perform GridSearch (or something similar to it, letting

R SVM return NA for predictions with missing data

北城余情 提交于 2019-12-10 17:07:02
问题 I am attempting to make predictions using a trained SVM from package e1071 but my data contains some missing values (NA). I would like the returned predictions to be NA when that instance has any missing values. I tried to use na.action = na.pass as below but it gives me an error "Error in names(ret2) <- rowns : 'names' attribute [150] must be the same length as the vector [149]". If I use na.omit then I can get predictions without instances with missing data. How can I get predictions

How to load previously stored svm classifier?

╄→尐↘猪︶ㄣ 提交于 2019-12-10 16:59:37
问题 I'm working with openCV SVM in Visual Studio. (OpenCV 2.4.4.0) I trained it: mySVM.train(trainingDataMat, labelsMat, Mat(), Mat(), params); Saved it: mySVM.save("classifier.xml"); I'm loading it like this: CvSVM mySVM1; mySVM1.load("C:\classifier.xml"); mySVM1.predict(testingDataMat0,result0); And i want to use in other project. But when i try to load classifier this error bumps all the time: "Bad argument (The SVM should be trained first) in CvSVM::predict" Path is correct, and .xml seems

Python scikit svm “ValueError: X has 62 features per sample; expecting 337”

妖精的绣舞 提交于 2019-12-10 16:33:12
问题 Playing around with Python's scikit SVM Linear Support Vector Classification and I'm running into an error when I attempt to make predictions: ten_percent = len(raw_routes_data) / 10 # Training training_label = all_labels[ten_percent:] training_raw_data = raw_routes_data[ten_percent:] training_data = DictVectorizer().fit_transform(training_raw_data).toarray() learner = svm.LinearSVC() learner.fit(training_data, training_label) # Predicting testing_label = all_labels[:ten_percent] testing_raw

How to load SVM data from file in OpenCV 3.1?

 ̄綄美尐妖づ 提交于 2019-12-10 15:43:41
问题 I have a problem with load trained SVM from file. I use Python and OpenCv 3.1.0. I create svm object by: svm = cv2.ml.SVM_create() Next, I train svm and save to file by: svm.save('data.xml') Now i want to load this file in other Python script. In docs i can't find any methods to do it. Is there a trick to load svm from file? Thanks for any responses. 回答1: I think it's a litte bit confusing that there is no svm.load(filepath) method as a counterpart of svm.save(filepath), but when I read the

“Error in table(pred = prediction, true = W[, 8]) : all arguments must have the same length”

久未见 提交于 2019-12-10 14:50:14
问题 this is my data: Anon_Student_Id Problem_Hierarchy Problem_Name Problem_View Number_Of_Steps Sum_Of_Steps_Duration Sum_Of_Hints result 1 80nlN05JQ6 Unit ES_01, Section ES_01-6 EG21 8 3 28 0 1 2 80nlN05JQ6 Unit ES_01, Section ES_01-6 EG21 9 3 37 0 0 3 80nlN05JQ6 Unit ES_01, Section ES_01-6 EG21 10 3 50 0 0 4 80nlN05JQ6 Unit ES_01, Section ES_01-6 EG22 1 3 78 0 0 5 80nlN05JQ6 Unit ES_01, Section ES_01-6 EG22 2 3 41 0 1 6 80nlN05JQ6 Unit ES_01, Section ES_01-6 EG22 3 3 92 0 0 I'm trying to

Model is empty, SVM in e1071 package

情到浓时终转凉″ 提交于 2019-12-10 14:32:00
问题 I have a matrix of N examples x 765 features. To this, there is a vector of N labels for each of those examples. I am trying to use SVM to classify them and make predictions. It worked in one instance when I was splitting the whole data into training and validation using this a manual half-split: indicator<-1:(length(idx)/2) training <- idx[indicator] test<-idx[-indicator] However, if I try to randomize the halves out of each class in the loop by using this: indicator<-sample(idx, trunc