Interactive ML application for Hepatitis C classification using PyTorch with Streamlit interface
Project description
Hepatitis C Predictor
Developing a Deep Learning model with PyTorch to identify patterns and predict the presence of Hepatitis C from patient data, paving the way for faster, more accurate diagnostics.
Features
- ๐ Interactive Data Exploration: Visualize and explore the Hepatitis C dataset
- ๐ Model Training Interface: Train models with custom hyperparameters
- ๐ Model Evaluation: Comprehensive performance metrics and visualizations
- ๐ค Deep Learning: PyTorch-based neural network with residual connections
- ๐ฆ Auto-download: Dataset downloads automatically if not present
Dataset
The dataset contains laboratory values from blood donors and Hepatitis C patients:
- Source: UCI Machine Learning Repository / Kaggle
- Size: 615 samples
- Features: 12 laboratory measurements + age and sex
- Target: Binary classification (Healthy vs Hepatitis C)
- Auto-download: The app will automatically download the dataset if not present
Model
- Architecture: Deep Neural Network with Residual Connections
- Input Layer: 12 features
- Hidden Layers: [128, 64, 32] neurons
- Residual Blocks: 2 per hidden layer
- Output Layer: 2 classes (Binary classification)
- Framework: PyTorch 2.8+
- Regularization: Layer Normalization + Dropout (0.3)
- Expected Accuracy: ~97.5% on validation set
๐ Deployment
Requirements for Deployment
- Python 3.10
- All dependencies listed in
requirements.txt - Dataset will be downloaded automatically on first run
License
This project is licensed under the MIT License - see the LICENSE file for details.
Important Note
โ ๏ธ This model is for educational purposes only. Do not use for actual medical diagnosis. Always consult healthcare professionals.
To run it locally:
uvx --from hepatitis-c-predictor --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ hepatitis-c-demo
Docs
You can check the modules docs in the docs folder or directly from the deployed version on GH pages here: https://ninjalice.github.io/HEPATITIS_C_MODEL/src.html
Getting Started
-
Clone the repository:
git clone https://github.com/Ninjalice/HEPATITIS_C_MODEL.git cd HEPATITIS_C_MODEL
-
Install dependencies:
pip install -r requirements.txt
Or using
uv:uv sync --frozen
-
Run the interactive dashboard:
streamlit run app.py
The app will automatically download the dataset if not present.
Option 2: Jupyter Notebooks
Follow the notebooks in order:
01-data-exploration.ipynb- Explore the dataset02-data-preprocessing.ipynb- Clean and prepare data03-model-training.ipynb- Train the neural network04-model-prediction.ipynb- Make predictions on new data (WIP)
Manual Download (Optional)
If auto-download fails, you can manually download from:
- Kaggle: https://www.kaggle.com/datasets/fedesoriano/hepatitis-c-dataset
- Place the file in
data/raw/hepatitis_data.csv
Project Organization
โโโ data/
โ โโโ raw/ <- The original, immutable data dump
โ โโโ processed/ <- The final, canonical data sets for modeling
โ
โโโ models/ <- Trained and serialized models
โ
โโโ notebooks/ <- Jupyter notebooks for analysis and modeling
โ โโโ 01-data-exploration.ipynb
โ โโโ 02-data-preprocessing.ipynb
โ โโโ 03-model-training.ipynb
โ โโโ 04-model-prediction.ipynb
โ
โโโ reports/ <- Generated analysis as HTML, PDF, LaTeX, etc.
โ โโโ figures/ <- Generated graphics and figures
โ
โโโ src/ <- Source code for use in this project
โ โโโ __init__.py
โ โโโ data.py <- Scripts to download or generate data
โ โโโ train.py <- Scripts to train models
โ โโโ models.py <- Scripts to train models and make predictions
โ โโโ visualization.py <- Scripts to create exploratory visualizations
โ
โโโ requirements.txt <- The requirements file for reproducing the environment
โโโ README.md <- The top-level README for developers
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hepatitis_c_predictor-0.4.2.tar.gz.
File metadata
- Download URL: hepatitis_c_predictor-0.4.2.tar.gz
- Upload date:
- Size: 23.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
702d0607aad79b3012d050872753aa82394ed7fd956bec99df8e3e0d0295db75
|
|
| MD5 |
66e9069c3ff43f6259a69f8956f5591c
|
|
| BLAKE2b-256 |
42443ec2a5360ef692319005a39eaf54c6fdb01f51f8c890b6b856ecb8bc387f
|
File details
Details for the file hepatitis_c_predictor-0.4.2-py3-none-any.whl.
File metadata
- Download URL: hepatitis_c_predictor-0.4.2-py3-none-any.whl
- Upload date:
- Size: 26.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
942cabe7e905a2e1c9c3c1c71d7ca73f642024ae9b9c1c0538f974153591de2e
|
|
| MD5 |
5b44f12676de665eb9b085b2fd00c583
|
|
| BLAKE2b-256 |
017b5d558cfef576ce11287c4f78abb47686cf7aa7a0d1399c071006ad8a088f
|