i have data set of 200 images, and i have calculated color related features and texture related features of those images. now i have color related features of shape (54,), and texture related features of shape (48,). I have to feed these values to a SVM. But i am new to python and machine learning ..
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 ..
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 ..
How do I label 20 different intra-class objects in a single image captured together for model training? The test image is also a single image containing objects to be classified. Source: Python-3x..
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 ..
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 ..
I’ve managed to plot the decision boundary of a support vector machine in 2D and 3D. Now, I’d like to plot the normal vector of it as well, but in a way that works not only in 2D / 3D but also in higher-dimensional spaces. At the moment, I’m simply calculating the normal vector by ..
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 ..
In relation to this post, the accepted answer explained the penalty and the loss in the regularisation problem of the SVM. However at the end the terms ‘l1-loss’, ‘l2-loss’ are used. As I understand, the objective function in the regularisation problem is the sum of the loss function, e.g. the hinge loss: sum_i [1- y_i ..
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)) 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, ..