# set LOGDIR to default if not set before if [ -z "$LOGDIR" ]; then echo "LOGDIR is not set. Using default '../logs/vote_log'" export LOGDIR="../logs/vote_log" fi mkdir -p results # for battle data python -m elo_rating.clean_battle_data battle_cutoff_date=`cat cut_off_date.txt` && rm cut_off_date.txt && echo "Battle data last updated on $battle_cutoff_date" mkdir -p ./results/$battle_cutoff_date cp clean_battle_$battle_cutoff_date.json ./results/latest/clean_battle.json mv clean_battle_$battle_cutoff_date.json ./results/$battle_cutoff_date/clean_battle.json python -m elo_rating.elo_analysis --clean-battle-file ./results/$battle_cutoff_date/clean_battle.json mv ./elo_results_$battle_cutoff_date.pkl ./results/$battle_cutoff_date/elo_results.pkl # generate the leaderboard python -m elo_rating.generate_leaderboard \ --model_info_file "../model/model_registry.csv" \ --elo_rating_pkl "./results/$battle_cutoff_date/elo_results.pkl" \ --output_csv "./results/$battle_cutoff_date/leaderboard.csv" mkdir -p ./results/latest cp ./results/$battle_cutoff_date/leaderboard.csv ./results/latest/leaderboard.csv cp ./results/$battle_cutoff_date/elo_results.pkl ./results/latest/elo_results.pkl