1

I know one common way to ignore warnings in Python is to use:

import warnings
warnings.filterwarnings('ignore')

And I do put these two lines up-above import <package-to-ignore> , it didn't work, warnings still poped up, and I also tried to add warnings.filterwarnings multiple times, still not working. The package I use is sklearn and some lines have parallel processing. I know this is the reason but I don't know how to fix it.
Appreciated if you can help.

Zehao_W
  • 71
  • 1
  • 3

1 Answers1

0

have you tried this answer?

def warn(*args, **kwargs):
    pass
import warnings
warnings.warn = warn

#... import sklearn stuff...
H. pap
  • 339
  • 1
  • 10
  • 1
    Still not working(same problem 'What about when doing GridSearchCV in parallel' had been asked in comment under this answer), I tried to change some of the score functions to avoid this prob though. – Zehao_W Jul 08 '20 at 00:25