0

我正在knn使用下一个代码对我的数据集进行分类:

from sklearn.model_selection import train_test_split

X_train, X_test, y_train, y_test = train_test_split(accidentes[['col1', 'col2', 'col3']],accidentes['col4'], train_size=0.7, shuffle=False)
knn = KNeighborsClassifier(n_neighbors=3, algorithm='auto', metric='manhattan')
knn.fit(X_train, y_train)
X_test['predictions'] = knn.predict(X_test)

但我想在 python中绘制这个knn分类器。plotly我该怎么做?

4

1 回答 1

0

只需按照此https://plotly.com/python/knn-classification/示例处理您的数据即可。

于 2019-09-03T13:04:49.030 回答