avgupta456 / statbotics

📈 Modernizing Data Analytics for FRC Robotics
https://statbotics.io/
MIT License
64 stars 9 forks source link

RP probability values for alliances in the Playoffs? #375

Open INeedCaffeine opened 2 months ago

INeedCaffeine commented 2 months ago

When I look at the raw data for a get_matches() call, I see that I get back RP probability values on all of the Playoff data I get back.
This can easily be seen running this script:

import statbotics
import pprint

sb = statbotics.Statbotics()

matches = sb.get_matches( team=6413, event="2024azva", ascending=True )
pprint.pprint( qual_matches )

In the output I see non-zero values for blue_rp_1_prob, blue_rp_2_prob, red_rp_1_prob and red_rp_2_prob. Below is what I see for the last returned match (Finals 3):

{... 'blue_rp_1': 0, 'blue_rp_1_epa_sum': 0.8619, 'blue_rp_1_prob': 0.8096, 'blue_rp_2': 0, 'blue_rp_2_epa_sum': -0.3079, 'blue_rp_2_prob': 0.038, 'blue_score': 82, ... 'key': '2024azva_f1m3', ... 'red_rp_1': 0, 'red_rp_1_epa_sum': 1.4384, 'red_rp_1_prob': 0.9771, 'red_rp_2': 0, 'red_rp_2_epa_sum': 0.315, 'red_rp_2_prob': 0.323, ...}

I was expecting those values to all be 0's once we got into the Playoffs since RPs are non-existent at that point. I thought it could simply be some value that floated along through the Playoffs but I noticed on Finals 2, the match before this one, the 'red_rp_1_prob' was 0.9745, which is different than what I see above for Finals 3.

Am I missing something with regard to the RP related stats in the Playoff matches?

I'm running the 2.0.3 statbotics package on Pyton 3.11.

avgupta456 commented 2 months ago

Thanks for your question. You are correct that RPs are not relevant in playoffs and could be set to 0, although I float them through for simplicity. You are also correct that RP ratings are not updated in the playoffs.

An (unfortunately undocumented) change I made this season is to us component EPAs to predict ranking points when possible. For the 2024 game, I use the # of Notes component EPA to predict the melody RP. This has the benefit of receiving continuous data from the FIRST API and handling scaling cutoffs. The notes component EPA is updated (with a lower weight, just like total EPA) during playoffs, and so the rp_1 probability is updated as well.

I will work on documenting this better. Let me know if that makes sense!