Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence warning for GaussianNormalizer.fit #443

Closed
npatki opened this issue Mar 18, 2022 · 0 comments
Closed

Silence warning for GaussianNormalizer.fit #443

npatki opened this issue Mar 18, 2022 · 0 comments
Assignees
Labels
feature request Request for a new feature
Milestone

Comments

@npatki
Copy link
Contributor

npatki commented Mar 18, 2022

RDT version: 1.0.0 (dev branch)

Problem Description

Right now, the fit function in the GaussianNormalizer transformer always prints out the following RuntimeWarning statements from scipy:

/usr/local/lib/python3.7/dist-packages/scipy/stats/_continuous_distns.py:5320: RuntimeWarning: divide by zero encountered in true_divide
  return c**2 / (c**2 - n**2)
/usr/local/lib/python3.7/dist-packages/scipy/stats/_distn_infrastructure.py:2606: RuntimeWarning: invalid value encountered in double_scalars
  Lhat = muhat - Shat*mu

These are very frequently triggered for a variety of datasets and are not immediately useful to the end user.

Expected behavior

Let's silence only these two RuntimeWarnings in this call. That is, the user should be able to see all other warnings just now these two.

We can use the warnings module.

import warnings

# silence the warnings
warnings.filterwarnings('ignore')

<code>

# stop silencing the warnings?
warnings.filterwarnings('default')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

3 participants