我试着在网上找到一个,但失败了。5D数据集是一个列表列表,如下所示
[[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],
......]
谢谢。
发布于 2020-02-27 10:32:54
您能提供您的完整数据和标签吗?有了所需的数据,您的答案将在不到一分钟内准备好。
# 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]]))
https://stackoverflow.com/questions/60430701
复制