Name | crunchdao-crunch-example JSON |
Version |
0.3.2
JSON |
| download |
home_page | None |
Summary | CrunchDAO example packages for machine learning competitions |
upload_time | 2025-07-11 09:18:33 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.11 |
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. |
keywords |
classification
competition
crunchdao
iris
machine learning
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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 package provides iris classification utilities with a dual structure:
```python
# Import base class from namespace package
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
The package provides a dual structure:
### Namespace Package (for base classes)
- `crunchdao.crunch_example.iris` - Namespace package containing IrisModelBase
- Accessible via: `from crunchdao.crunch_example.iris import IrisModelBase`
### Direct Package (for examples and utilities)
- `crunchdao_crunch_example/` - Main package with examples and utilities
- `models/` - Example model implementations (not importable packages)
- `neural_network/` - Multi-layer perceptron with sklearn
- `random_forest/` - Ensemble tree-based classifier
- `svm/` - Support vector machine classifier
- `scripts/` - Utility scripts for training and model management (not importable packages)
### Model Examples
The package includes complete model implementations:
- **Neural Network** (`models/neural_network/`) - Multi-layer perceptron with sklearn
- **Random Forest** (`models/random_forest/`) - Ensemble tree-based classifier
- **SVM** (`models/svm/`) - Support vector machine classifier
Each model includes:
- Pre-trained model files in `resources/`
- Implementation code in `submissions/main.py`
- Dependencies in `submissions/requirements.txt`
### Utility Scripts
The `scripts/` directory contains:
- `pretrain_models.py` - Train all models on iris dataset
- `pretrain_neural_network.py` - Specific neural network training
- `sync_models.py` - Sync models with storage systems
- `cleanup_docker.py` - Docker environment cleanup
## 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.
Raw data
{
"_id": null,
"home_page": null,
"name": "crunchdao-crunch-example",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "classification, competition, crunchdao, iris, machine learning",
"author": null,
"author_email": "CrunchDAO <boris.nieuwenhuis@crunchdao.com>",
"download_url": "https://files.pythonhosted.org/packages/b5/08/666f87531b64ac0a4ae6bce574493f65b460447fe22ce6abc9e81316c640/crunchdao_crunch_example-0.3.2.tar.gz",
"platform": null,
"description": "# CrunchDAO Crunch Example\n\nThis package provides example utilities and base classes for CrunchDAO machine learning competitions.\n\n## Installation\n\n```bash\npip install crunchdao-crunch-example\n```\n\n## Usage\n\n### Iris Classification\n\nThe package provides iris classification utilities with a dual structure:\n\n```python\n# Import base class from namespace package\nfrom crunchdao.crunch_example.iris import IrisModelBase\nimport pandas as pd\n\nclass MyIrisModel(IrisModelBase):\n def train(self, train_data: pd.DataFrame) -> None:\n # Implement your training logic here\n # train_data contains features and target labels\n pass\n \n def infer(self, dataframe: pd.DataFrame) -> pd.DataFrame:\n # Implement your inference logic here\n # dataframe contains features to predict on\n predictions = [0, 1, 2] # Your model predictions\n \n return pd.DataFrame({\n 'prediction': predictions\n })\n\n# Use your model\nmodel = MyIrisModel()\n\n# Training data with features and target\ntrain_data = pd.DataFrame({\n 'sepal_length': [5.1, 4.9, 4.7],\n 'sepal_width': [3.5, 3.0, 3.2],\n 'petal_length': [1.4, 1.4, 1.3],\n 'petal_width': [0.2, 0.2, 0.2],\n 'species': [0, 0, 0] # 0=setosa, 1=versicolor, 2=virginica\n})\n\nmodel.train(train_data)\n\n# Test data with just features\ntest_data = pd.DataFrame({\n 'sepal_length': [6.1, 5.9],\n 'sepal_width': [2.9, 3.0],\n 'petal_length': [4.7, 4.2],\n 'petal_width': [1.4, 1.5]\n})\n\npredictions = model.infer(test_data)\nprint(predictions)\n```\n\n## Package Structure\n\nThe package provides a dual structure:\n\n### Namespace Package (for base classes)\n- `crunchdao.crunch_example.iris` - Namespace package containing IrisModelBase\n - Accessible via: `from crunchdao.crunch_example.iris import IrisModelBase`\n\n### Direct Package (for examples and utilities) \n- `crunchdao_crunch_example/` - Main package with examples and utilities\n - `models/` - Example model implementations (not importable packages)\n - `neural_network/` - Multi-layer perceptron with sklearn\n - `random_forest/` - Ensemble tree-based classifier \n - `svm/` - Support vector machine classifier\n - `scripts/` - Utility scripts for training and model management (not importable packages)\n\n### Model Examples\n\nThe package includes complete model implementations:\n\n- **Neural Network** (`models/neural_network/`) - Multi-layer perceptron with sklearn\n- **Random Forest** (`models/random_forest/`) - Ensemble tree-based classifier \n- **SVM** (`models/svm/`) - Support vector machine classifier\n\nEach model includes:\n- Pre-trained model files in `resources/`\n- Implementation code in `submissions/main.py`\n- Dependencies in `submissions/requirements.txt`\n\n### Utility Scripts\n\nThe `scripts/` directory contains:\n- `pretrain_models.py` - Train all models on iris dataset\n- `pretrain_neural_network.py` - Specific neural network training\n- `sync_models.py` - Sync models with storage systems\n- `cleanup_docker.py` - Docker environment cleanup\n\n## Development\n\n### Requirements\n\n- Python 3.11+\n- uv (for dependency management)\n\n### Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/crunchdao/coordinator-setup\ncd coordinator-setup/examples/crunch_examples\n\n# Install dependencies\nuv sync\n\n# Install in development mode\nuv pip install -e .\n```\n\n### Testing\n\n```bash\nuv run pytest\n```\n\n### Building\n\n```bash\n# Build the package\nuv build\n\n# Upload to PyPI (requires authentication)\nuv publish\n```\n\n## License\n\nMIT License - see LICENSE file for details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.",
"bugtrack_url": null,
"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.",
"summary": "CrunchDAO example packages for machine learning competitions",
"version": "0.3.2",
"project_urls": {
"Documentation": "https://docs.crunchdao.com",
"Homepage": "https://github.com/crunchdao/coordinator-setup",
"Issues": "https://github.com/crunchdao/coordinator-setup/issues",
"Repository": "https://github.com/crunchdao/coordinator-setup"
},
"split_keywords": [
"classification",
" competition",
" crunchdao",
" iris",
" machine learning"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "63745f43b4aef418ab40e1bdcaf19c793923f1889b7bfe534f345fbbf0f5ed3a",
"md5": "c0f30b741729f673aa3730e09e5d1338",
"sha256": "1ef45f0841cfdf8cb34e879d3880b9736e9b97f9486baca90f53877b53d5e9de"
},
"downloads": -1,
"filename": "crunchdao_crunch_example-0.3.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c0f30b741729f673aa3730e09e5d1338",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 177255,
"upload_time": "2025-07-11T09:18:32",
"upload_time_iso_8601": "2025-07-11T09:18:32.213690Z",
"url": "https://files.pythonhosted.org/packages/63/74/5f43b4aef418ab40e1bdcaf19c793923f1889b7bfe534f345fbbf0f5ed3a/crunchdao_crunch_example-0.3.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "b508666f87531b64ac0a4ae6bce574493f65b460447fe22ce6abc9e81316c640",
"md5": "7854e1722e9752762e8fe1aa3ef57842",
"sha256": "71ffe086427d482614a9ccfa27b93c5e79b524441b0c5dbbada907acb8f4c673"
},
"downloads": -1,
"filename": "crunchdao_crunch_example-0.3.2.tar.gz",
"has_sig": false,
"md5_digest": "7854e1722e9752762e8fe1aa3ef57842",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 167739,
"upload_time": "2025-07-11T09:18:33",
"upload_time_iso_8601": "2025-07-11T09:18:33.316527Z",
"url": "https://files.pythonhosted.org/packages/b5/08/666f87531b64ac0a4ae6bce574493f65b460447fe22ce6abc9e81316c640/crunchdao_crunch_example-0.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-11 09:18:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "crunchdao",
"github_project": "coordinator-setup",
"github_not_found": true,
"lcname": "crunchdao-crunch-example"
}