Category : svm

I try to use thundersvm for train the svm on my local gpu with jupyter notebook. I installed thundersvm as described here (https://github.com/Xtra-Computing/thundersvm/blob/master/docs/get-started.md) and it worked after I Had to try a few times. After that I build the solution in Visual Studio 17. If I try to import thundersvm (from thundersvm import SVC) in ..

Read more

I’m just trying out a SVC classifier on the Social Media Ads dataset from Kaggle, and it performs well, but when I go to plot the decision boundaries, it predicts the entire mesh to 1. Here’s the initial SVC, all hyperparameters on default: from sklearn.svm import SVC model = SVC() model.fit(X_train,y_train) y_train_pred = model.predict(X_train) y_test_pred ..

Read more

I am trying to implement a Linear SVM solution in Python by hand. def train_OvO(X_train, y_train, train_func, param): classes = sorted(set(y_train)) estimators = dict() for i,ci in enumerate(classes): for j,cj in enumerate(classes): if j>i: X = X_train.copy() X = X[np.logical_or(y_train==ci,y_train==cj)] y = y_train.copy() y = y[np.logical_or(y_train==ci,y_train==cj)] yp = y.copy() yp[y==ci] = 1 yp[y==cj] = -1 ..

Read more

Question The parameter decision_function_shape of the sklearn.svm.SVC object seems not to be decisive at all on the output itself, but only reshaping the array of the score of each classifier. But is there any way to understand how the array is transformed in the basic implementation of the object (OvO strategy and ovr default argument ..

Read more

I am currently training a svc for a dataframe with a lot of columns with one of these columns as a target X = df.iloc[:, :-1] y = df.target X = full_pipeline.fit_transform(X) X_train, X_test, y_train, y_test = model_selection.train_test_split(X, y, train_size=0.80, test_size=0.20, random_state=101) linear = svm.SVC(kernel=’linear’, degree=3, C=1).fit(X_train, y_train) When I type linear.coef_, I get a ..

Read more

This is my code if some body can help ,that will be great, i want to train face images with cnn and svm. I have tried all techniques but can’t resolve it. I have resize image into 64,64. How can i resolve this ?? print(len(x_save[0])) x_save = np.array(x_save).reshape(len(x_save),16384).astype(float) x_save.shape 16384 (1108, 16384) X_train, X_test, y_train, ..

Read more