如何计算预测的准确性?

问题描述

我已经从包含一些分类参数的数据集中创建了一个excel。然后,我创建了一个测试数据集,并对这些数据进行了分类。现在,我对所有测试数据都有预测了,但是如何找到这些预测的准确性呢?

df = pd.read_excel(r"excellocation")
df_model = df.copy()
scaler = StandardScaler()
features =  [[feature1,feature2......]]
for feature in features:
    df_model[feature] = scaler.fit_transform(df_model[feature])
knn = KNeighborsClassifier()
x = df_model.drop(columns=['class'],1)
y = df_model['class']
knn.fit(x,y)
clf= neighbors.KNeighborsClassifier()
clf.fit(x,y)
for example in test_data:
     prediction = clf.predict(example)
#####i need accuracy of this prediction

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)