Overview
The Coordinator directory contains the core implementation of the Iris Classification Coordinator - the system that ties all pieces of the Crunch together. This directory demonstrates the three fundamental responsibilities that every Coordinator must implement.Architecture
The Coordinator follows a modular architecture where each component has a single, well-defined purpose:The Three Core Responsibilities
1. Data Management
Manage all data operations for the iris classification challenge. Key Functions:- Load the iris dataset from scikit-learn
- Split data into training and prediction sets (stratified sampling)
- Save datasets as CSV files locally.
- Select what data to use when calling the train and infer functions of the models.
- Handle data transformations and formatting
2. Model Orchestration
Administer game rules and coordinate communication with the distributed model cluster. Key Functions:- Initialize connections to model cluster via gRPC
- Send training data to all available models
- Collect predictions from all models
- Handle cluster availability and failover scenarios
- Manage model lifecycle (start, train, predict, cleanup)
Orchestrator Code Example
Orchestrator Code Example
3. Scoring & Rewards
Evaluate model performance and distribute prizes. Key Functions:- Score predictions against ground truth
- Calculate multiple performance metrics (accuracy, precision, recall, F1)
- Generate prize distributions based on rankings
- Create leaderboards and save results
- Handle tie-breaking and ranking logic
Main Coordinator
The main Coordinator class ties all three responsibilities together.Running the Coordinator
Basic Usage
Output Files
The Coordinator generates output files to publish the prizes and the leaderboard:prizes.json- Prize distribution resultsleaderboard.csv- Final ranked leaderboard
Local Testing
Will help you get the complete infrastructure containerized environment with blockchain integration