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

Remove np.warnings from fairness_utils.py. #580

Merged
merged 1 commit into from
Jan 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rsmtool/fairness_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"""

import pickle
import warnings
from os.path import join

import numpy as np
import pandas as pd
import statsmodels.formula.api as smf
from rsmtool.container import DataContainer
Expand Down Expand Up @@ -270,10 +270,10 @@ def get_fairness_analyses(df,
# we filter warnings for this function because we get
# runtime warning due to NaNs in the data.
# these seem to be by design: https://groups.google.com/forum/#!topic/pystatsmodels/-flY0cNnb3k
np.warnings.filterwarnings('ignore')
warnings.filterwarnings('ignore')
anova_results = anova_lm(csd_null_fit, csd_fit)
# we reset warnings
np.warnings.resetwarnings()
warnings.resetwarnings()

# collect the results. Note that R2 in this case is a difference
# in R2 between the two models and significance is obtained from anova
Expand Down