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).
Where:
explainers/class-imbalance.md.Bug 1: the Detection Code imports
from imblearn.over_sampling import SMOTE, butimbalanced-learn/imblearnis not listed anywhere inrequirements-lock.txt. Following this repo's own documented install path (pip install -r requirements-lock.txt) and then running this code block fails withModuleNotFoundError.Bug 2: the file claims baseline models flag "around 0.2% to 0.3%" of patients as high-risk. Reproducing via the real
faircodepipeline (faircode.manifest,faircode.strategies.encode_features,faircode.models.build_model, baseline strategy,Healthcare Readmission/audit.yaml,random_state=42):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-learntorequirements-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).