krishnakamathk
krishnakamathk

Reputation: 143

What is sklearn.cross_validation.cross_val_score

Just wondering what exactly is sklearn.cross_validation.cross_val_score? The documentation says it to be internal scoring method. Does it give FPR/Precision/Recall ?

Upvotes: 3

Views: 8167

Answers (2)

eickenberg
eickenberg

Reputation: 14377

By default cross_val_score uses the scoring provided in the given estimator, which is usually the simplest appropriate scoring method. E.g. for most classifiers this is accuracy score and for regressors this is r2 score.

If you want to use a different scoring method you can pass a scorer to cross_val_score using the scoring= keyword. You can choose anything from sklearn.metrics.scorer (but it may not work if it is not appropriate to your setting [classification / regression]).

Upvotes: 8

krishnakamathk
krishnakamathk

Reputation: 143

I just found that the cross_val_score calls score function of respective estimator/classifier which for eg in case of SVM is mean accuracy predict(x) wrt y.

Upvotes: 1

Related Questions