1

I have build a custom estimator in sklearn, according to the documentation. Inside the fit method, I have a print statement, which I use for debugging. When I create an instance of this model and call the fit method, everything is working as expected. However, when calling cross_val_score, the statements are not printed anymore, although as far as I know, cross_val_score calls the fit method at each fold. Is there any way to force the print statement inside cross-validation?

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Radu Gh
  • 33
  • 3

1 Answers1

1

Parallel processing in sklearn is handled by joblib. When running cross_val_score with n_jobs != 1, evidently that doesn't play nicely with Jupyter output:
Printed output not displayed when using joblib in jupyter notebook

Ben Reiniger
  • 10,517
  • 3
  • 16
  • 29