I am new to machine learning, and am using k-fold cross validation on my model. I am using cross_val_score.
The documentation states that cross_val_score
returns an array of "scores." Is score the same as accuracy? I can't really find an answer to this online.
The "score" used in cross_val_score
can be specified by the scoring
argument to the function. From the docs (same link as in the question):
scoring : string, callable or None, optional, default: None A string (see model evaluation documentation) or a scorer callable object / function with signature scorer(estimator, X, y) which should return only a single value.
Similar to cross_validate but only a single metric is permitted.
If None, the estimator’s default scorer (if available) is used.
So, you can pass accuracy as a score, but if you don't specify any specific score, the estimator's default will be used. If I'm not mistaken, the estimator's default is usually just its loss function. By the fact you're discussing accuracy, I'm assuming you're dealing with a classification problem, where the loss is the cross-entropy... so, this is what you're probably seeing.
You can verify this by calculating the loss and comparing to your score.