Downloads · 30 days
0
nsklab/anemia-sr-cbc-lightgbm
anemia-sr-cbc-lightgbm is a machine learning model from nsklab. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Downloads · 30 days
0
Access
Public
Updated Sep 23, 2026
Repo size
405 KB
Likes
0
Public
Click a slice to open those files.
.txt1 MB · 70%
From the Hugging Face model README
Introduction
Published machine-learning models for anaemia detection from complete blood count (CBC) data routinely report accuracies between 94% and 99.8%. This one reports 91%, and that gap is the entire point of the model. Anaemia is not a disease that a model discovers in blood data — it is defined as a haemoglobin concentration below a threshold. So when a classifier is handed haemoglobin as an input feature and asked to predict a label that was generated by thresholding haemoglobin, it is not learning to detect disease. It is recovering an arithmetic cut-off that whoever assembled the dataset already knew. In the cohort behind this model, that degeneracy is total. A one-question decision tree using haemoglobin alone reproduces the label with 1.0000 accuracy, in training and under five-fold cross-validation; splitting at Hb ≤ 11.95 g/dL. The two classes' haemoglobin ranges do not overlap by a single observation. Haemoglobin in this dataset is not a predictor of the label. It is the label, rewritten on a continuous scale. So haemoglobin was removed, and a harder question was asked instead: how much anaemia signal do the remaining red-cell indices actually carry? This model is the answer, and 0.91 accuracy / 0.81 MCC is what that answer honestly looks like.
To run:
# Make sure you have git-lfs installed
git lfs install
# Clone the repository
git clone https://huggingface.co
from huggingface_hub import snapshot_download
# This downloads the repository to your local cache and returns the path
model_dir = snapshot_download(repo_id="nsklab/anemia-sr-cbc-lightgbm")
print(f"Model downloaded to: {model_dir}")
#then call the model using preset params
import os
import lightgbm as lgb
import pandas as pd
from huggingface_hub import snapshot_download
# 1. Download/locate the files
model_dir = snapshot_download(repo_id="nsklab/anemia-sr-cbc-lightgbm")
# 2. Find the LightGBM model file (typically named model.txt or similar)
model_file = os.path.join(model_dir, "model.txt")
# 3. Load the model
bst = lgb.Booster(model_file=model_file)
# 4. Prepare your features
# The description notes it uses 7 routine CBC indices, with Hemoglobin deliberately excluded.
# Ensure your DataFrame columns match the exact 7 features expected by the model.
my_features = pd.DataFrame([{
"RBC": 4.5,
"WBC": 7.0,
"MCV": 85.0,
# ... include the remaining features required by the dataset
}])
# 5. Predict anemia signal
prediction = bst.predict(my_features)
print("Anemia Probability:", prediction)