Skip to content

drewscottt/batting_order_analysis

Repository files navigation

Description

Simulates every possible batting order for a given lineup and displays summary statistics of the average runs (over a number of games) of the orders, and specific information about the top and bottom 5 orders. The user may choose how many games each order is simulated for, which players are in the lineup, or what each player's PA outcomes are in a single game (see sample files).

Data Source

Baseball Savant Custom Data

Major TODOs

  1. Determine the accurate likelihoods of sacrifices and double plays for different out types
  2. Enable some sort of pinch hitting scheme (right now, each player hits the entire game)
  3. Enable some sort of pitcher dependent hitting results (even as simple as right-y/left-y; right now hitting stats are full season aggregates)
  4. Include edge cases like stealing, wild pitches, etc.
  5. More detailed data (i.e. did a double go to right or left field?)
  6. Player specific data (i.e. how often does a player try to steal?)

Installation

pip install batting-order-analysis

View on PyPI

Usage

driver.py and driver.ipynb supply a basic interface, check them out

About

Determines the best batting order for a team by simulating games. Player plate appearance data from Baseball Savant.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published