0

I use the nightly build of scikit and when I fit estimators I get this warning which is caused py the yeo.yohnson power transformer:

/home/xxxx/anaconda3/envs/MASTER/lib/python3.10/site-packages/numpy/core/_methods.py:235: RuntimeWarning: overflow encountered in multiply
  x = um.multiply(x, x, out=x)

Versions: Numpy 1.22.3 Scikit 1.2.dev0

I can not really debug it, because I do not know where excatly the overflow happens so I tried to filter or turn off the warning with all these statements seperately. I use Anaconda and Jupyter Notebook.

1.

import warnings
warnings.filterwarnings("ignore")
  1. warnings.filterwarnings(action='once')

  2. np.seterr(all="ignore")

I tried a few others but nothing worked. HOWEVER except for numpy all other warnings are successfully surpressed. Why is this happening? It seems that numpy is a special case where this does not work?

Nils Lcrx
  • 57
  • 5
  • Tried [these three lines](https://stackoverflow.com/a/71857703/8508004) in your notebook? Tried `%%capture --no-display` [here](https://softhints.com/turn-off-warnings-jupyterlab-jupyter-notebook/). Unfortunately you didn't provide a minimal reproducible example so that others could test the suggestions. There's fancier and finer 'captures' available that can be used to suppress unwanted output. For example, if numpy is using a C extension there then maybe [wurlitzer](https://github.com/minrk/wurlitzer) would be needed. – Wayne May 10 '22 at 15:32
  • 1
    I think the problem might be related to threads and processes. How does warning behave if the error is produced in another thread or process? – Nils Lcrx May 11 '22 at 09:10
  • Or even more how does it behave if the additional thread produces the warning – Nils Lcrx May 11 '22 at 09:11

0 Answers0