Metadata-Version: 2.4
Name: crunchdao-crunch-example
Version: 0.0.1
Summary: CrunchDAO example packages for machine learning competitions
Project-URL: Homepage, https://github.com/crunchdao/coordinator-setup
Project-URL: Documentation, https://docs.crunchdao.com
Project-URL: Repository, https://github.com/crunchdao/coordinator-setup
Project-URL: Issues, https://github.com/crunchdao/coordinator-setup/issues
Author-email: CrunchDAO <boris.nieuwenhuis@crunchdao.com>
License: MIT License
        
        Copyright (c) 2024 CrunchDAO
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: classification,competition,crunchdao,iris,machine learning
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: pandas>=2.0.0
Provides-Extra: dev
Requires-Dist: black>=23.0; extra == 'dev'
Requires-Dist: isort>=5.0; extra == 'dev'
Requires-Dist: mypy>=1.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Description-Content-Type: text/markdown

# CrunchDAO Crunch Example

This package provides example utilities and base classes for CrunchDAO machine learning competitions.

## Installation

```bash
pip install crunchdao-crunch-example
```

## Usage

### Iris Classification

The `crunchdao.crunch_example.iris` package provides base classes for iris classification models:

```python
from crunchdao.crunch_example.iris import IrisModelBase
import pandas as pd

class MyIrisModel(IrisModelBase):
    def train(self, train_data: pd.DataFrame) -> None:
        # Implement your training logic here
        # train_data contains features and target labels
        pass
    
    def infer(self, dataframe: pd.DataFrame) -> pd.DataFrame:
        # Implement your inference logic here
        # dataframe contains features to predict on
        predictions = [0, 1, 2]  # Your model predictions
        
        return pd.DataFrame({
            'prediction': predictions
        })

# Use your model
model = MyIrisModel()

# Training data with features and target
train_data = pd.DataFrame({
    'sepal_length': [5.1, 4.9, 4.7],
    'sepal_width': [3.5, 3.0, 3.2],
    'petal_length': [1.4, 1.4, 1.3],
    'petal_width': [0.2, 0.2, 0.2],
    'species': [0, 0, 0]  # 0=setosa, 1=versicolor, 2=virginica
})

model.train(train_data)

# Test data with just features
test_data = pd.DataFrame({
    'sepal_length': [6.1, 5.9],
    'sepal_width': [2.9, 3.0],
    'petal_length': [4.7, 4.2],
    'petal_width': [1.4, 1.5]
})

predictions = model.infer(test_data)
print(predictions)
```

## Package Structure

This package uses namespace packaging to allow for future expansion:

- `crunchdao.crunch_example.iris` - Iris classification utilities
- Future: `crunchdao.crunch_example.forex` - Forex prediction utilities
- Future: `crunchdao.crunch_example.crypto` - Cryptocurrency utilities

## Development

### Requirements

- Python 3.11+
- uv (for dependency management)

### Setup

```bash
# Clone the repository
git clone https://github.com/crunchdao/coordinator-setup
cd coordinator-setup/examples/crunch_examples

# Install dependencies
uv sync

# Install in development mode
uv pip install -e .
```

### Testing

```bash
uv run pytest
```

### Building

```bash
# Build the package
uv build

# Upload to PyPI (requires authentication)
uv publish
```

## License

MIT License - see LICENSE file for details.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.