Skip to main content

Store, manage, and compare machine learning experiments

Project description

MLT Experiments Library

A Python library for managing machine learning experiments. Store, retrieve, compare, and analyze your ML experiments effortlessly.

Features

Easy Experiment Tracking

  • Save experiment configurations, hyperparameters, models, and results
  • Automatic timestamps and metadata management

📊 Experiment Comparison

  • Compare multiple experiments side-by-side
  • Find best experiments by metric
  • Export to CSV for analysis

🏷️ Flexible Organization

  • Tag experiments for easy filtering
  • List experiments by tag
  • Full experiment history

📁 Multiple Data Formats

  • JSON export/import
  • CSV export for spreadsheets
  • Pandas DataFrame integration

Installation

From PyPI (once published)

pip install mlt-experiments

From source

git clone https://github.com/yourusername/mlt-experiments.git
cd mlt-experiments
pip install -e .

Quick Start

from mlt_experiments import ExperimentTracker

# Initialize tracker
tracker = ExperimentTracker(data_dir="my_experiments")

# Save an experiment
tracker.save(
    experiment_name="baseline_v1",
    config={
        "model": "RandomForest",
        "learning_rate": 0.01,
        "batch_size": 32,
        "epochs": 100
    },
    results={
        "accuracy": 0.92,
        "loss": 0.23,
        "precision": 0.89,
        "recall": 0.91
    },
    tags=["baseline", "v1"]
)

# Load an experiment
exp = tracker.load("baseline_v1")
print(exp)

# List all experiments
experiments = tracker.list_all()
print(experiments)

# Compare experiments
comparison = tracker.compare(["baseline_v1", "baseline_v2"], metric="accuracy")
print(comparison)

# Get best experiment by metric
best = tracker.get_best(metric="accuracy", mode="max")
print(f"Best: {best['name']}")

# Export to CSV
tracker.export_to_csv("experiments_summary.csv")

API Reference

ExperimentTracker

__init__(data_dir="experiments_data")

Initialize tracker with storage directory.

save(experiment_name, config, results, model_code="", tags=None)

Save experiment with metadata.

load(experiment_name)

Load specific experiment.

list_all()

Get list of all experiments.

list_by_tag(tag)

Get experiments with specific tag.

compare(experiment_names, metric=None)

Compare multiple experiments.

get_best(metric, mode="max")

Get best experiment by metric.

export_to_csv(output_file)

Export all experiments to CSV.

delete(experiment_name)

Delete an experiment.

Use Cases

  • Research: Track different model architectures and hyperparameters
  • Production: Compare model versions and performance
  • Team Collaboration: Share experiments across team members
  • Exam/Assignment: Store all lab work in organized, reproducible format

License

MIT License - see LICENSE file for details

Contributing

Contributions welcome! Please submit pull requests or issues.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

mlt_experiments-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file mlt_experiments-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mlt_experiments-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8fc11532afbc17392c263763f2a204bfb9a5787e4a16b34e4d6cd850d083c885
MD5 4b76fa53cbdc75a797e27605175d2678
BLAKE2b-256 f35e95f2fb2cb475ed61d405ebf4abf059049f19f44406e2bd59137fd68979b4

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