英文:
AttributeError: Can't get attribute 'EuclideanDistance' on <module 'sklearn.metrics._dist_metrics' from 'C:\\Python311\\Lib\\site-packages\\sklearn\\
问题
抱歉,我仍然是一个初学者。我想找出这个模型是否正常工作,但出现了错误。
knn_model = pickle.load(open('knn_pickle.sav', 'rb'))
value_Output = ''
data = (2, 12, 96, 53, 1, 1)
result_Prediction = knn_model.predict([data])
if(result_Prediction[0] == 1):
value_Output = 'It works'
else:
value_Output = "It doesn't work"
然后我遇到了这个错误:
AttributeError: 在'C:\\ Python311 \\ Lib \\ site-packages \\ sklearn \\ metrics \\ _dist_metrics.cp311-win_amd64.pyd'中,无法获取属性'EuclideanDistance'的值
有人可以帮助我吗?
英文:
Sorry I'm still a beginner. I want to find out if this model works properly or not, but there is an error.
knn_model = pickle.load(open('knn_pickle.sav', 'rb'))
value_Output = ''
data = (2, 12, 96, 53, 1, 1)
result_Prediction = knn_model.predict([data])
if(result_Prediction[0] == 1):
value_Output = 'It works'
else:
value_Output = "It doesn't work"
And then I hit this error:
AttributeError: Can't get attribute 'EuclideanDistance' on <module 'sklearn.metrics._dist_metrics'
from 'C:\\Python311\\Lib\\site-packages\\sklearn\\metrics\\_dist_metrics.cp311-win_amd64.pyd'>
Anyone can help me please?
答案1
得分: 1
Scikit-Learn 1.2.2的sklearn.metrics._dist_metrics
模块有EuclideanDistance()
和EuclideanDistance32()
。然而,版本1.3.0中有EuclideanDistance32()
和EuclideanDistance64()
,而不再有EuclideanDistance()
。我猜他们在1.3.0中用EuclideanDistance64()
替代了EuclideanDistance()
。
英文:
Scikit-Learn 1.2.2's sklearn.metrics._dist_metrics
module has EuclideanDistance()
and EuclideanDistance32()
. However, version 1.3.0 has EuclideanDistance32()
and EuclideanDistance64()
, instead of EuclideanDistance()
. I guess they replaced EuclideanDistance()
with EuclideanDistance64()
in 1.3.0.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论