File size: 3,019 Bytes
0d86eca
 
408f007
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0d86eca
408f007
88f5c08
408f007
88f5c08
408f007
88f5c08
 
408f007
88f5c08
 
408f007
 
 
 
 
88f5c08
 
408f007
88f5c08
408f007
88f5c08
408f007
 
 
 
 
 
 
88f5c08
408f007
 
 
 
 
 
 
 
 
 
 
88f5c08
408f007
 
 
 
 
88f5c08
 
 
 
408f007
 
 
 
 
 
 
 
 
 
 
 
 
 
88f5c08
408f007
 
88f5c08
 
 
 
 
 
 
408f007
 
 
88f5c08
408f007
88f5c08
408f007
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---

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