Does a Pipeline object store the score of the data it trained with?

I was wondering if a saved model in a Pipeline object contains the score of the data with which it has been trained. If so, how to get that score without having to put the data back in?

1 answer

  • answered 2022-04-29 15:19 Ben Reiniger

    This depends on the model. Mostly, no. Also, you'd need to specify what exactly you mean by "score"; there are many metrics that might be saved somewhere.

    kNN models store the training data in a private attribute _fit_X (source), so you could recreate a score from that (though you're not really saving much work here).

    HistGradientBoosting models store an iteration-wise training and validation score (docs). GradientBoosting models similarly save loss functions at each iteration.

    Cross-validation models like LogisticRegressionCV save the cross-validation scores for each hyperparameter value. Those are significantly different from a training score though.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum