A Python package for plotting machine learning training metrics
Project description
ml-graphy
A Python package for plotting machine learning training metrics with automatic detection of validation data and clean, publication-ready visualizations.
Features
- 📊 Automatic detection of training and validation metrics
- 🎨 Clean, publication-ready plots using seaborn styling
- 📈 Support for loss and accuracy metrics
- 🔍 Automatic handling of missing data
- 📋 Training summary statistics
Installation
pip install ml-graphy
This will automatically install all required dependencies:
numpy>=1.20.0matplotlib>=3.5.0seaborn>=0.11.0
Development Installation
git clone https://github.com/Prasoon-Rai/Graphy.git
cd Graphy
pip install -e ".[dev]"
Quick Start
from graphy import plot_metrics
# Assuming you have a trained model with history
# model.history = {
# 'loss': [0.5, 0.4, 0.3, 0.2],
# 'accuracy': [0.8, 0.85, 0.9, 0.95],
# 'val_loss': [0.6, 0.45, 0.35, 0.25],
# 'val_accuracy': [0.75, 0.8, 0.85, 0.9]
# }
plot_metrics(model)
This will automatically:
- Detect available metrics (loss, accuracy)
- Check for validation data
- Create side-by-side plots
- Display training summary statistics
Publishing to PyPI
This package uses GitHub releases for automated publishing. See RELEASE.md for instructions.
Quick Release Process
- Update version in
pyproject.toml - Commit and push changes
- Create a GitHub release
- GitHub Actions automatically publishes to PyPI
Requirements
- Python >= 3.8
- numpy >= 1.20.0
- matplotlib >= 3.5.0
- seaborn >= 0.11.0
All dependencies are automatically installed when you install ml-graphy.
Testing
Test the package after installation:
from graphy import plot_metrics
# Create a mock model with training history
class MockModel:
def __init__(self):
self.history = {
'loss': [0.8, 0.6, 0.4, 0.3, 0.2],
'accuracy': [0.6, 0.7, 0.8, 0.85, 0.9],
'val_loss': [0.9, 0.7, 0.5, 0.4, 0.3],
'val_accuracy': [0.55, 0.65, 0.75, 0.8, 0.85]
}
model = MockModel()
plot_metrics(model)
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Development
For development, install with:
pip install -e ".[dev]"
This includes additional tools:
- pytest for testing
- black for code formatting
- flake8 for linting
- mypy for type checking
Project details
Release history Release notifications | RSS feed
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 ml_graphy-0.1.0.tar.gz.
File metadata
- Download URL: ml_graphy-0.1.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c546ed48222e46be462d33949f5dc4aba5790d1f4cb89f925728b95c8b2f6dc7
|
|
| MD5 |
191766c39eb3501af4104d9467e244db
|
|
| BLAKE2b-256 |
822719340b6c958aa4b9cdcde130186411cba540d540a7b9651ca98aa5dea0cd
|
File details
Details for the file ml_graphy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ml_graphy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98c427ff3cf0dcf6fde4c3681256f0e5860333ac49e1f40126138bc7220afc4a
|
|
| MD5 |
0fafc726051bf101ba74beeb2059285b
|
|
| BLAKE2b-256 |
02c8aced7e63cc8a12d19df81c6e8c2aba7c7cabd393a2d626e06e77336113ea
|