英文:
scikit-learn documentation example: 'got an unexpected keyword argument'
问题
当运行来自scikit-learn文档的此示例时,我收到错误消息 v_measure_score()
获得了一个意外的关键字参数 beta
:
from sklearn import metrics
labels_true = [0, 0, 0, 1, 1, 1]
labels_pred = [0, 0, 1, 1, 2, 2]
metrics.v_measure_score(labels_true, labels_pred, beta=0.6)
看起来像是scikit-learn.metrics中的一个错误... 有什么见解吗?
英文:
When running this example from the scikit-learn documentation, I get the error v_measure_score() got an unexpected keyword argument 'beta'
:
from sklearn import metrics
labels_true = [0, 0, 0, 1, 1, 1]
labels_pred = [0, 0, 1, 1, 2, 2]
metrics.v_measure_score(labels_true, labels_pred, beta=0.6)
It looks like a bug in sklearn.metrics... Any insights?
答案1
得分: 1
你可能正在使用一个旧版本的scikit-learn。根据scikit-learn的文档,beta关键字是在版本0.21中引入的。
英文:
You might be using an old version of scikit-learn.
According to scikit-learn documentation the beta keyword was introduced in version 0.21
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论