Statbotics.io: 2022 Season

Hi everyone! With Week 1 in the books, I wanted to reintroduce the FRC community to Statbotics (statbotics.io). Statbotics aims to modernize FRC data analytics, and currently includes Elo and OPR data, available through a website, REST API, and Python package.

A few examples:

2022 Global Elo and OPR Rankings

Stay up to date on the most dominant FRC teams this season. So far, 1678 has already hit an Elo of 2000, and five teams have an OPR of at least 50. Check the full page out at Teams - Statbotics.

Event Insights and Simulation

For completed and ongoing events, understand the competitive landscape through Elo and OPR tables and graphs. Event simulation is experimental, but should improve as the season progresses. Check out the full page at statbotics.io/event/2022caph.

Explore with the Python API

The Statbotics Python API allows you to query years, teams, events, and matches, filtering and ordering by several fields. Here’s a quick example to load the top 5 teams in Israel in 2022 by Elo as of Week 1. Check the documentation at statbotics.readthedocs.io.

import statbotics

sb = statbotics.Statbotics()

sb.get_team_years(year=2022, country="Israel", fields=["team", "name", "elo_max", "opr_no_fouls"], metric="elo_max", limit=5)
[{'team': 1690, 'name': 'Orbit', 'elo_max': 1948, 'opr_no_fouls': 55.1},
 {'team': 1577, 'name': 'Steampunk', 'elo_max': 1691, 'opr_no_fouls': 25.97},
 {'team': 1574, 'name': 'MisCar', 'elo_max': 1656, 'opr_no_fouls': 26.77},
 {'team': 2231, 'name': 'OnyxTronix', 'elo_max': 1621, 'opr_no_fouls': 15.25},
 {'team': 5654, 'name': 'Phoenix', 'elo_max': 1616, 'opr_no_fouls': 25.11}]

A script runs every six hours to query data from TheBlueAlliance and keep Statbotics up-to-date. The full documentation and code is available on GitHub: GitHub - avgupta456/statbotics: 📈 Modernizing Data Analytics for FRC Robotics.

I will be using this thread to broadcast feature updates, share data observations, and answer any questions you all may have. I am excited to see how everyone uses this platform, and please let me know if I can answer any questions or improve anything. Thanks!

28 Likes

I tried playing with the site during week 1 events, and i noticed that throughout the weekend i couldnt access any tabs besides the basic “insights” tab when looking at any event. Now that those events are all completed, I can access the other features such as the qual/elim predictions and simulations tabs for those week 1 events. Is this by design?

The percentiles are backwards. Percentile is the percent of other items in the population that are below that item. Said another way, what percent are you better than. 99th percentile is very good. Also, the percent sign is generally not used with percentiles, since it’s not expressing a portion of a whole, but rather a place along a scale.

3 Likes

The basic “insights” tab is shown for any upcoming events. When an event is ongoing, additional partial information is shown. Statbotics was not fully operational last week, as I was swamped with coursework. Yesterday I fixed some bugs and got the system online, so hopefully everything works smoothly moving forward.

Thanks for the feedback. I’ll add it to my issues list and get to it soon!

1 Like

This is one of the most underrated FRC sites. The pre-event Elos/OPRs and Elo over time graphs are especially helpful and insightful.

6 Likes

Gotcha. Will try it again this weekend.

1 Like

Looking at my team: Team 329 - Statbotics :


When sorting by ELO percentile it looks like you are treating those as strings not numbers so the sort is off. It looks like the same situation with OPR percentile. Other than that, I am spending WAY too much time playing with this site.

2 Likes

How often is the site updated? I don’t see a bunch of teams on the leaderboard that I would’ve expected to be on there

1 Like

The site is updated every six hours (though I may increase this frequency depending on cost). Only teams that have played matches this season are included. Are there specific teams you aren’t seeing that I could investigate?

is the site taking into the account the odd way that day one events are doing eliminations?

Statbotics gets its data from TBA, and TBA gets its data from FIRST’s APIs, so it seems to me that the whole chain of people are waiting for FIRST to correctly report the results of single day events.

5 Likes

I took a look at this and it is super cool. We will definitely be using this to supplement our own scouting.

2 Likes

Some recent bug fixes:

  • Data is now updated from TBA every two hours (previously every six hours)
  • Within the event page, the Elo/OPR vs. Rank graphs are now rendering correctly. Matches are now in the correct chronological order. Some simulation edge cases have been fixed,
  • Percentiles (and sorting) on the team pages have been fixed @zeta @Matt_Boehm_329

Two features I want to draw attention to that might be useful for teams at competitions this week:

  1. Elo vs. Rank and OPR vs Rank graphs:

For ongoing (and completed) events, a scatterplot of Elo/OPR vs rank is included. This may be useful as an additional data point when looking for alliance partners.

  1. Event Simulation

The simulation page takes into account upcoming match win and RP probabilities to forecast the remaining schedule and compute ranks. Teams can use this page to estimate their rank and think through alliance selection scenarios.

Note: I have observed the RP predictions are generally underestimates as the model is still learning which teams can consistently hit the RPs. A similar TBA feature exists, but it does not take into account Elo to my knowledge.

2 Likes

Does statbotics take into account red card matches during playoffs when determining OPR? I know there has been a few red cards this season already during finals so I am wondering if/should red carded matches be dropped from the calculations for more accurate results?

2 Likes

Thanks for bringing up this point. Currently, red carded matches are included in the OPR/Elo calculations. I would need to run a historical analysis to determine if removing these matches improves model predictions. I have created a GitHub issue to track this task.

With that said, I believe the impact of red carded playoff matches should be minimal. OPR is only based on qualification matches, and Elo is weighted 1/3 in elimination rounds. I saw your alliance was red carded this week - this led to an 11 point decrease in Elo. Meanwhile, your team gained 11+ Elo in four separate qualification matches. Let me know if you have any questions!

3 Likes

Terrific site! On the Figures page for events, is there any chance of getting the OPR graphs for more than just the top 15? That is such a nice representation.

That’s a great suggestion, I have gone ahead and implemented a button that toggles the chart between top 15 and entire event. Let me know what you think!

See for example: statbotics.io/event/2022nytr

3 Likes

That’s awesome! Thanks so much. Also wild to see the graph turn upside down there at the end!

1 Like

This site is awesome I am very glad you created it. I did have one question that I was confused about. How are you generating the list of OPRs for future events?

3 Likes

Thanks for the question. At the start of a season, OPR seeds are generated by converting a team’s previous year OPR to current year OPR via linear scaling and applying 20% mean reversion to the average OPR (average match score / 3).

\text{OPR}_\text{seed}=0.80*\text{OPR}_\text{prev} * \frac{\text{AVG}_\text{curr}}{\text{AVG}_\text{prev}}+0.2*\frac{\text{AVG}_\text{curr}}{3}

After a team has competed during the season, the OPR seed for the next event is the OPR from the most recent event. During an event, ixOPR is used to smoothly update past information with match outcomes. You can read more on the procedure on the TBA GitHub. At the end of the event, a team’s OPR is fully determined by that event’s match outcomes.

There was a bug where a team’s second event OPR was using the start-of-season seed instead of the most recent in-season event. This has now been resolved. I will work on increasing transparency for the methods being used on the site.

Let me know if you see any other discrepancies or have any further questions!

2 Likes