>It's in a few places, we could refactor it. For now, this should be a try/finally, though, see the implementation of f1_score in the metrics module. (If anything below fails, the error settings for the whole process change.)

I think that to do a try/finally I would still need to change the settings. The default behavior is the printing of a warning.

>I think that this pattern (deactivate and and re-activate warnings) often appears in scikit-learn and could be factored using a with statement. CC @larsmans 

Should I open an issue about this?