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.
Where:
Healthcare Readmission/fair.py, the mitigated-model feature-list comment.The gap: The mitigated-model feature list drops
number_inpatientas a proxy but keepsnumber_outpatient, justified by:Using the script's own binary race split (
is_minority = ~race.isin(['Caucasian','Asian'])), the opposite holds:The racial gap in
number_outpatient(0.161) is roughly 3.7x the gap innumber_inpatient(0.044) -number_outpatientis more racially stratified, not less, so the stated rationale for keeping it in the "fair" feature set while droppingnumber_inpatientis backwards.Repro:
Fix direction: Either correct the comment (
number_outpatientis 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 alongsidenumber_inpatientif the goal is minimizing racial-proxy signal.