Given your team’s picks and both sides’ bans, it ranks the heroes still available. A scikit-learn random forest is trained over multi-hot hero vectors built from per-hero synergy and counter tables — 256 relationship files, one pair per hero.
Measured result
The training loop intends counters as negative examples — a comment says so — then appends them with the same input vector and the same label position as the synergy pairs. Nothing marks them as the opposite case, so the model learns association rather than advantage.
src/HeroSuggestor/main.py, prepare_training_data
Draft phase in a five-versus-five game is a constraint problem with public information: both sides’ bans, the picks so far, and a large table of which heroes work with and against which others. This turns that table into a model and the model into a ranked shortlist on the command line.
Heroes can be given by id or by name, with names normalised for spacing and punctuation, and everything already picked or banned is removed from the candidate set before scoring.
Each hero’s five best partners and five strongest counters become training samples: the hero as a multi-hot input vector, the related hero as the label. A random forest of a hundred trees learns that mapping, and scoring a candidate means asking the model how strongly it associates that candidate with the current team.
One detail decides what the output actually means. A comment in the training loop describes the counter pairs as negative samples, and they are then appended exactly like the synergy pairs — same input vector, same label position — so nothing in the data marks them as the opposite case. The model is trained on a single undifferentiated notion of relatedness.
What it therefore produces is heroes that appear in the neighbourhood of your picks: a useful prompt inside a thirty-second draft timer, and not a win probability. Reading it as the latter would take more from the training data than is in it. Correcting it means giving counters their own label or their own model, which is a different project rather than a patch.