arca-processor / README.md
Ciroc0's picture
Update arca-processor
8c04aa9 verified
|
raw
history blame
1.84 kB

ArcaThread Processor

Pre-computes champion statistics from matchup-matrix data for fast tier list generation.

What it does

  1. Scans matchup-matrix for latest patches every hour
  2. Aggregates data per champion (win rates, matchups, by role/rank)
  3. Generates JSON files at champ-stats/{patch}/{champion_id}.json
  4. Creates tier list at champ-stats/{patch}/tier-list.json

Output Structure

champ-stats/
β”œβ”€β”€ 16.4/
β”‚   β”œβ”€β”€ meta.json          # Patch metadata
β”‚   β”œβ”€β”€ tier-list.json     # Sorted tier list
β”‚   β”œβ”€β”€ 266.json           # Aatrox stats
β”‚   β”œβ”€β”€ 103.json           # Ahri stats
β”‚   └── ...
β”œβ”€β”€ 16.3/
β”‚   └── ...

Champion Stats Format

{
  "champion_id": 266,
  "total_games": 15420,
  "win_rate": 0.5234,
  "by_role": {
    "TOP": {"games": 12000, "win_rate": 0.5240},
    "JUNGLE": {"games": 3420, "win_rate": 0.5210}
  },
  "by_rank": {
    "DIAMOND": {"games": 3000, "win_rate": 0.5100},
    "MASTER": {"games": 1500, "win_rate": 0.5050}
  },
  "matchups": [
    {"enemy_champion_id": 54, "games": 500, "win_rate": 0.4800},
    ...
  ]
}

Environment Variables

Variable Default Description
HF_TOKEN (required) HuggingFace API token
DATASET_REPO ArcaThread/arca-thread-priors Target dataset
PROCESS_INTERVAL_SECONDS 3600 Run interval (1 hour)
MIN_SAMPLE_SIZE 100 Minimum games for inclusion

API Endpoints

  • GET / - Basic info
  • GET /health - Status and stats
  • GET /trigger - Manually trigger processing
  • GET /patch/{patch} - Patch processing status

Deployment

Deploy to HuggingFace Spaces as a Docker space. Set HF_TOKEN as a secret.