Contribute to mlcli

mlcli is open source and we welcome contributions! Whether it is fixing bugs, adding features, or improving documentation.

Getting Started

Terminal
# Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/MLcli.git
cd MLcli

# Create a virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install in development mode
pip install -e ".[dev]"

# Run tests to verify setup
pytest tests/

Ways to Contribute

Bug Reports

Found a bug? Open an issue on GitHub with steps to reproduce, expected behavior, and your environment details.

Code Contributions

Add new trainers, fix bugs, improve performance, or add new features. Check open issues for ideas.

Documentation

Improve docs, add examples, fix typos, or translate documentation to other languages.

Community

Help others in discussions, answer questions, share your use cases, and spread the word!

Adding a New Trainer

Python
# 1. Create a new trainer file
# mlcli/trainers/my_trainer.py

from mlcli.trainers.base_trainer import BaseTrainer

class MyTrainer(BaseTrainer):
    """My custom trainer."""

    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        # Initialize your model

    def train(self, X_train, y_train, X_val=None, y_val=None):
        # Training logic
        pass

    def predict(self, X):
        # Prediction logic
        pass

    def save(self, path):
        # Save model
        pass

    def load(self, path):
        # Load model
        pass

# 2. Register in registry.py
from mlcli.utils.registry import ModelRegistry
ModelRegistry.register("my_trainer", MyTrainer)

# 3. Add tests in tests/test_my_trainer.py
# 4. Update documentation

Code Style

  • Follow PEP 8 style guidelines
  • Use type hints for function signatures
  • Write docstrings for all public functions and classes
  • Run black and isort before committing
  • Ensure all tests pass with pytest
  • Add tests for new features
Terminal
# Format code
black mlcli/
isort mlcli/

# Run linting
flake8 mlcli/

# Run tests
pytest tests/ -v

Pull Request Process

  1. Fork the repository and create a new branch
  2. Make your changes and commit with clear messages
  3. Ensure all tests pass and add new tests if needed
  4. Update documentation if your changes affect it
  5. Open a PR with a clear description of your changes
  6. Address any review feedback
Thank you for contributing to mlcli!