--- license: mit tags: - tabular-regression - sklearn - card-game - flesh-and-blood - game-balance - educational library_name: sklearn pipeline_tag: tabular-regression datasets: - custom metrics: - r2 - mse - mae --- # FAB Prediction Model - Teklovossen Card Balance > **Educational Project - NOT affiliated with Legend Story Studios or the official Flesh and Blood game.** A scikit-learn model that predicts **win rates** for custom Teklovossen (Mechanologist) card decks in the [Flesh and Blood](https://fabtcg.com/) trading card game. This project explores how machine learning can be applied to game balance analysis using simulated gameplay data from a custom game engine. ## Model | Detail | Value | |--------|-------| | Type | `Pipeline(StandardScaler + RandomForestRegressor)` | | Task | Tabular regression - predict average win rate | | Framework | scikit-learn 1.8.0 | | Training data | Simulated gameplay (custom engine) | ## Features (inputs) | # | Feature | Description | |---|---------|-------------| | 0 | AI | AI-themed card count | | 1 | Nano | Nano-themed card count | | 2 | Quantum | Quantum-themed card count | | 3 | Base | Base card count | | 4-8 | 0_cost to 4_plus_cost | Cost curve distribution | | 9-11 | equipment, item, action | Card type counts | | 12 | avg_turns | Average game length | | 13 | avg_evos | Average Evo equipment used | | 14 | avg_teklo_energy | Avg Teklo Energy generated | | 15 | avg_nanite_counters | Avg Nanite counters | | 16 | avg_quantum_charges | Avg Quantum charges | | 17 | consistency_score | Deck consistency (0-1) | | 18 | avg_expert_balance_score | Expert balance score (1-10) | ## Output `avg_win_rate` - float in [0, 1] representing predicted deck win rate. ## Metrics | Metric | Value | |--------|-------| | Train R2 | 0.917 | | CV R2 (mean +/- std) | -1.3332 +/- 2.1072 | | Train MSE | 0.0049 | | Train MAE | 0.042 | | Samples | 9 | | Features | 17 | ## Quick Start ```python from huggingface_hub import hf_hub_download import joblib, numpy as np path = hf_hub_download(repo_id="4math/FAB_Prediction_Model", filename="model.joblib") model = joblib.load(path) # Example: a Nano-focused deck features = np.array([[9,0,0,2, 5,2,1,0, 9,9,12, 0.6, 9.4,13.6,7.3, 0.74, 6.7, 0,0]]) print(model.predict(features)) # predicted win rate ``` ## About This Project This is a fan-made educational project exploring ML for TCG game balance. The model is trained on simulated gameplay data from a custom Flesh and Blood game engine featuring Teklovossen, a Mechanologist hero with custom Evo cards across four tech themes: AI, Nano, Quantum, and Biomancy. ## Limitations - Trained on **simulated** data, not real tournament results - Small dataset (9 samples) - treat predictions as rough estimates - Simplified card mechanics in the simulation engine - Fan-made cards only - does not cover the official card pool ## License MIT