1

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.

FBruzzesi
  • 6,385
  • 3
  • 15
  • 37
  • 1
    That list of lists looks to me like the input data, but I don not see the labels/classes for each point. How do you plan to classify a set of points without classes? For Supervised Learning you need a labeled dataset. – ibarrond Feb 27 '20 at 10:16
  • I do have labels prepared, I didn't include the labels in the question just now, the labels are in a format of ["xxxxx“, "xxxxx", .....], I also have a combined dataset of the labels and the list above. – justsometeen Feb 27 '20 at 11:49

1 Answers1

1

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]]))
Amin Khodamoradi
  • 392
  • 1
  • 6
  • 18