Skip to content

Healthcare Readmission/fair.py keeps number_outpatient on the grounds it's "less racially stratified than inpatient" - the actual data shows the opposite #734

Description

@yakew7

Where: Healthcare Readmission/fair.py, the mitigated-model feature-list comment.

The gap: The mitigated-model feature list drops number_inpatient as a proxy but keeps number_outpatient, justified by:

    'number_outpatient',       # retained: outpatient visits (access to care signal,
                                #           less racially stratified than inpatient)

Using the script's own binary race split (is_minority = ~race.isin(['Caucasian','Asian'])), the opposite holds:

number_inpatient  by is_minority:  0=0.633   1=0.677   (abs. gap 0.044)
number_outpatient by is_minority:  0=0.410   1=0.249   (abs. gap 0.161)

The racial gap in number_outpatient (0.161) is roughly 3.7x the gap in number_inpatient (0.044) - number_outpatient is more racially stratified, not less, so the stated rationale for keeping it in the "fair" feature set while dropping number_inpatient is backwards.

Repro:

python3 -c "
import pandas as pd
df = pd.read_csv('Healthcare Readmission/diabetic_data.csv')
df = df[~df['race'].isin(['?'])]
df = df[df['gender'] != 'Unknown/Invalid']
df['is_minority'] = (~df['race'].isin(['Caucasian','Asian'])).astype(int)
print(df.groupby('is_minority')[['number_inpatient','number_outpatient']].mean())
"
#              number_inpatient  number_outpatient
# is_minority
# 0                    0.632968           0.410347
# 1                    0.677303           0.248594

Fix direction: Either correct the comment (number_outpatient is in fact more racially stratified by raw group means, so retaining it needs a different justification, e.g. weaker correlation in the trained model's actual feature importance), or reconsider dropping it alongside number_inpatient if the goal is minimizing racial-proxy signal.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions