I want to compute the micro average precision in scikit during cross validation.
The docs here:
http://scikit-learn.org/0.10/modules/cross_validation.html
Say you can pass in a custom scoring function from the metrics module such as metrics.precision_score:
But by default it computes the scores for each class. If I try and pass in average="micro"
like so:
cross_validation.cross_val_score(clf, x, label, cv=5,
score_func=metrics.precision_score(average="micro"))
I receive the following error:
TypeError: precision_score() takes at least 2 arguments (1 given)
I can't pass in all of the other arguments it wants (y_true
, y_pred
) as I don't know what y_pred
is.
Is there a way to get the micro average precision from cross validation in scikit ?