I have tried to find one online but failed. the 5D dataset is a list of lists like this
[[0,0,0,1,0],
[0,0.5,0.5,0,0],
[0,0.33333,0.33333,0.33333,0],
[1,0,0,0,0],
......]
Thanks.
I have tried to find one online but failed. the 5D dataset is a list of lists like this
[[0,0,0,1,0],
[0,0.5,0.5,0,0],
[0,0.33333,0.33333,0.33333,0],
[1,0,0,0,0],
......]
Thanks.
May you provide your full data and labels? With the required data, your answer will be ready in less than a minute.
# importing numpy and SVC from svm
import numpy as np
from sklearn.svm import SVC
# Example data and labels (you can replace with your data and lables).
X = np.array([[-1, -1], [-2, -1], [1, 1], [2, 1]])
y = np.array([1, 1, 2, 2])
# Building SVM model
clf = SVC(gamma='auto')
# Training Model
clf.fit(X, y)
# predicting with above mode(you can replace with your test data that have 5 dimesion).
print(clf.predict([[-0.8, -1]]))