‘scikit-learn documentation example: ‘got an unexpected keyword argument”

huangapple go评论75阅读模式
英文:

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

huangapple
  • 本文由 发表于 2023年3月9日 18:30:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/75683345.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定