scikit-learn
scikit-learn copied to clipboard
[MRG] Fix Erroneous Avg. Loss calculation
Reference Issues/PRs
Fixes #23753
What does this implement/fix? Explain your changes.
Fix avg. loss calculation in presence of validation set and subsequently update the condition for early stopping
Any other comments?
Introduced a variable train_count to keep a track of the samples used for training.
Thanks for the PR @Harsh14901. If I'm not mistaken train_count = n_samples - validation_mask.sum(). It would be more efficient to compute it once before entering the outer loop.