Generate predicted bracket from a kaggle march madness machine learning competition submission. https://www.kaggle.com/c/march-machine-learning-mania-2017
To install, do one of the following two things:
pip install bracketeer
OR
git clone https://github.com/cshaley/bracketeer.git
cd bracketeer
python setup.py install
from bracketeer import build_bracket
b = build_bracket(
outputPath='output.png',
teamsPath='sample/Teams.csv',
seedsPath='sample/NCAATourneySeeds.csv',
submissionPath='sample/submit_example.csv',
slotsPath='sample/NCAATourneySlots.csv',
resultsPath=None,
year=2019
)
resultsPath
is an optional CSV
file containing
results of games already played. If it is provided then in
the cases that the team the user predicted to win
loses, it will substitute the actual winning team. This is
intended to visualize the predictions for later rounds, after the
match-ups are set.
Example,
from bracketeer import build_bracket
b = build_bracket(
outputPath='output_current.png',
teamsPath='sample/Teams.csv',
seedsPath='sample/NCAATourneySeeds.csv',
submissionPath='sample/submit_example.csv',
slotsPath='sample/NCAATourneySlots.csv',
resultsPath='sample/current_results_example.csv',
year=2019
)
- binarytree
- matplotlib
- numpy
- pandas
- PIL
Additional input data/files not provided on kaggle:
- empty_bracket.jpg - empty ncaa bracket
- slot_coordinates.py - mapping dictionary from slots to image coordinates on empty_bracket.jpg
- ordered_seed_list.py - order of seeds on the bracket
Output is a bracket filled in with team seeds, names, and winning likelihood for each game.
The empty bracket is shown below.
The predicted bracket (this program's output) is shown below, for a set of randomly generated predictions:
The predicted bracket, after applying known results for the first round (based on the first round of the 2019 tournament):