Skip to content

class-imbalance.md imports imblearn (not in requirements-lock.txt) and misstates a real flagging rate #643

Description

@yakew7

Where: explainers/class-imbalance.md.

Bug 1: the Detection Code imports from imblearn.over_sampling import SMOTE, but imbalanced-learn/imblearn is not listed anywhere in requirements-lock.txt. Following this repo's own documented install path (pip install -r requirements-lock.txt) and then running this code block fails with ModuleNotFoundError.

Bug 2: the file claims baseline models flag "around 0.2% to 0.3%" of patients as high-risk. Reproducing via the real faircode pipeline (faircode.manifest, faircode.strategies.encode_features, faircode.models.build_model, baseline strategy, Healthcare Readmission/audit.yaml, random_state=42):

logistic_regression: 0.42%
random_forest:       0.18%
gradient_boosting:   0.26%

Two of three land near the claimed range, but logistic regression is noticeably above it - about 40-100% higher than the stated upper bound of 0.3%.

Fix direction: either add imbalanced-learn to requirements-lock.txt/the relevant extra (if SMOTE should actually be runnable) or note it as an illustrative external dependency the way other explainers do for packages not in this repo's lock file; widen or correct the claimed "0.2% to 0.3%" range to include the real logistic-regression figure (or state per-model figures instead of one range).

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 workinghelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions