Skip to main content

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.0
  • matplotlib>=3.5.0
  • seaborn>=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

  1. Update version in pyproject.toml
  2. Commit and push changes
  3. Create a GitHub release
  4. 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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ml_graphy-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ml_graphy-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

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

Hashes for ml_graphy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c546ed48222e46be462d33949f5dc4aba5790d1f4cb89f925728b95c8b2f6dc7
MD5 191766c39eb3501af4104d9467e244db
BLAKE2b-256 822719340b6c958aa4b9cdcde130186411cba540d540a7b9651ca98aa5dea0cd

See more details on using hashes here.

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

Hashes for ml_graphy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 98c427ff3cf0dcf6fde4c3681256f0e5860333ac49e1f40126138bc7220afc4a
MD5 0fafc726051bf101ba74beeb2059285b
BLAKE2b-256 02c8aced7e63cc8a12d19df81c6e8c2aba7c7cabd393a2d626e06e77336113ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page