Metadata-Version: 2.4
Name: mlt-experiments-urk23cs5035
Version: 0.2.0
Summary: Store, manage, and compare machine learning experiments
Home-page: https://github.com/yourusername/mlt-experiments
Author: MLT Lab
Author-email: MLT Lab <your-email@example.com>
Project-URL: Homepage, https://github.com/yourusername/mlt-experiments
Keywords: machine-learning,experiments,tracking,ml
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=1.0.0
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: black>=21.0; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# 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

🚀 **11 Pre-defined ML Experiments** *(NEW in v0.2.0)*
- View complete code for 11 different ML algorithms with just `mlt.exp(i)`
- Includes: Linear Regression, Logistic Regression, Decision Trees, Random Forest, SVM, K-Means, XGBoost, Neural Networks, Naive Bayes, PCA, Cross-Validation
- Perfect for learning and reference

## Installation

### From PyPI (once published)
```bash
pip install mlt-experiments
```

### From source
```bash
git clone https://github.com/yourusername/mlt-experiments.git
cd mlt-experiments
pip install -e .
```

## Quick Start

### Viewing Experiment Code (NEW in v0.2.0)

```python
import mlt_experiments as mlt

# Show Linear Regression code (Experiment 1)
mlt.exp(1)

# Show all available experiments
mlt.list_experiments()

# Get experiment code programmatically
code = mlt.get_experiment_code(5)  # SVM
```

### Tracking Your Experiments

```python
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

### Experiment Library (NEW in v0.2.0)

#### `exp(experiment_id: int)`
Display the code for a specific ML experiment (1-11).

```python
mlt.exp(1)  # Show Linear Regression
mlt.exp(5)  # Show SVM
mlt.exp(11) # Show Cross-Validation
```

#### `list_experiments()`
Display all 11 available experiments with names and descriptions.

```python
mlt.list_experiments()
```

#### `get_experiment_code(experiment_id: int) -> str`
Get the code for an experiment as a string.

```python
code = mlt.get_experiment_code(5)
with open("svm_experiment.py", "w") as f:
    f.write(code)
```

#### `get_experiment_info(experiment_id: int) -> dict`
Get complete info (name, description, code) for an experiment.

```python
info = mlt.get_experiment_info(7)
print(info['name'])        # Gradient Boosting (XGBoost)
print(info['description']) # ...
print(info['code'])        # Full code
```

### 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.
