Skip to content

About

Comparative Machine Learning Analysis of Serum Metabolomics for Multi-class Classification of Type 2 Diabetes, Inflammatory Bowel Disease, and Colorectal Cancer

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

🧬 Multi-Disease Prediction via Serum Metabolomics

Comparative ML analysis of serum metabolomics for multi-class classification of Type 2 Diabetes (T2D), Inflammatory Bowel Disease (IBD), and Colorectal Cancer (CRC) — with batch correction, nested cross-validation, and bootstrapped confidence intervals.

License: MIT Python R


📖 Table of Contents


Overview

This project addresses a clinically important challenge: distinguishing between three metabolic/inflammatory conditions — T2D, IBD, and CRC — using serum metabolomics data alone. Because samples originate from different study cohorts, batch effects are a major confound and are corrected using ComBat before any model training.

The full pipeline trains and rigorously evaluates 8 classifiers under a nested 5-fold cross-validation framework with inner hyperparameter tuning, producing bootstrapped 95% confidence intervals on ROC-AUC. Both binary (one-vs-rest) and multiclass variants are implemented.


Pipeline

Raw CSV datasets (IBD / T2D / CRC)
         │
         ▼
  Feature alignment (union of metabolites)
         │
         ▼
  ┌──────────────────────────────────────┐
  │  Per outer fold (5-fold, parallel)   │
  │  ┌─────────────────────────────────┐ │
  │  │ 1. ComBat batch correction      │ │
  │  │ 2. RF-based iterative imputation│ │
  │  │ 3. log1p transform              │ │
  │  │ 4. Pareto scaling               │ │
  │  └─────────────────────────────────┘ │
  └──────────────────────────────────────┘
         │
         ▼
  Inner 3-fold CV → hyperparameter search
         │
         ▼
  8 classifiers evaluated in parallel
         │
         ▼
  Metrics: Accuracy · F1 (macro) · ROC-AUC
  Bootstrap 95% CI on ROC-AUC (n=1000)

Models

Model Tuning
Logistic Regression Grid search (C, penalty, solver)
SVM (Linear) Grid search (C, class_weight)
SVM (RBF) Random search (C, gamma)
Random Forest Random search (n_estimators, max_depth, …)
XGBoost Random search (learning_rate, subsample, …)
k-Nearest Neighbours Grid search (k, weights, metric)
MLP (Neural Network) Random search (layers, alpha, lr)
PLS-DA Grid search (n_components)

Getting Started

Prerequisites

  • Python ≥ 3.8
  • R ≥ 4.0 (for Interactions.R only)

Installation

# 1. Clone the repo
git clone https://github.com/RabmitDas/Multi_disease_prediction.git
cd Multi_disease_prediction

# 2. Create and activate a virtual environment
python -m venv venv
source venv/bin/activate        # macOS / Linux
# venv\Scripts\activate         # Windows

# 3. Install Python dependencies
pip install -r requirements.txt

# 4. (Optional) R dependencies
Rscript -e "install.packages(c('ggplot2', 'dplyr'))"  # adjust as needed

Requirements

Create a requirements.txt in the repo root with:

numpy
pandas
scikit-learn
xgboost
matplotlib
joblib
pycombat

Usage

Multiclass classification (T2D vs IBD vs CRC)

python Multiclass.py

Before running, update the OUT_DIR and dataset paths in Multiclass.py:

OUT_DIR = "/path/to/your/data"   # line ~40

paths = {
    "IBD": f"{OUT_DIR}/IBD101_Y.csv",
    "T2D": f"{OUT_DIR}/T2D101_Y.csv",
    "CRC": f"{OUT_DIR}/CRC101_Y.csv",
}

Outputs (written to OUT_DIR):

  • Pooled_Multiclass_Model_Metrics_ComBat_Tuned.csv — summary metrics for all models
  • Pooled_Multiclass_Detailed_Results_Tuned.csv — per-fold breakdown
  • Pooled_Multiclass_ROC_ComBat_Tuned.png — ROC curves (1200 dpi)

Binary classification

python Binary.py

Metabolite interaction analysis (R)

Rscript Interactions.R

Project Structure

Multi_disease_prediction/
├── Multiclass.py          # Main pipeline: 8 models, nested CV, ComBat
├── Binary.py              # Binary (one-vs-rest) classification variant
├── Interactions.R         # R script for metabolite interaction analysis
├── requirements.txt       # Python dependencies  ← add this
├── LICENSE
├── CONTRIBUTING.md
├── CHANGELOG.md
└── README.md

Roadmap

  • Add requirements.txt
  • Add data download/access instructions
  • Fill in results table with actual metrics
  • Add ROC curve figure to assets/
  • Refactor hardcoded OUT_DIR to a CLI argument
  • Add a Jupyter notebook for interactive exploration

License

Distributed under the MIT License. See LICENSE for more information.


Citation

If you use this code in your research, please cite:

@misc{das2026multidisease,
  author = {Das, Rabmit},
  title  = {Multi-Disease Prediction via Serum Metabolomics},
  year   = {2026},
  url    = {https://github.com/RabmitDas/Multi_disease_prediction}
}

Acknowledgements

About

Comparative Machine Learning Analysis of Serum Metabolomics for Multi-class Classification of Type 2 Diabetes, Inflammatory Bowel Disease, and Colorectal Cancer

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages