scikit-learn documentation example: 'got an unexpected keyword argument'

Question:

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?

Asked By: Luminita

||

Answers:

You might be using an old version of scikit-learn.
According to scikit-learn documentation the beta keyword was introduced in version 0.21

Answered By: sensorer