{"id":23916799,"url":"https://github.com/bobona/zerosumbaseball","last_synced_at":"2026-05-16T00:04:59.716Z","repository":{"id":251437963,"uuid":"804492798","full_name":"BOBONA/ZeroSumBaseball","owner":"BOBONA","description":"We apply a zero-sum stochastic model of baseball to optimizing batting lineups.","archived":false,"fork":false,"pushed_at":"2024-08-02T17:43:34.000Z","size":96112,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-05T12:14:16.947Z","etag":null,"topics":["baseball","game-theory","machine-learning","permutation-algorithms","value-iteration","zero-sum-game"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BOBONA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-22T17:33:40.000Z","updated_at":"2024-08-02T23:05:58.000Z","dependencies_parsed_at":"2024-08-03T02:05:53.709Z","dependency_job_id":null,"html_url":"https://github.com/BOBONA/ZeroSumBaseball","commit_stats":null,"previous_names":["bobona/zerosumbaseball"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BOBONA%2FZeroSumBaseball","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BOBONA%2FZeroSumBaseball/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BOBONA%2FZeroSumBaseball/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BOBONA%2FZeroSumBaseball/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BOBONA","download_url":"https://codeload.github.com/BOBONA/ZeroSumBaseball/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240371743,"owners_count":19790888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["baseball","game-theory","machine-learning","permutation-algorithms","value-iteration","zero-sum-game"],"created_at":"2025-01-05T12:14:22.334Z","updated_at":"2026-05-16T00:04:59.678Z","avatar_url":"https://github.com/BOBONA.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zero-Sum Baseball\n\n![A research poster of this repo's work](presentation/poster-small.jpg)\n\nThis project demonstrates how a zero-sum stochastic game model of baseball can be\nused to approach more complex baseball problems. We explore some strategies for optimizing \nbatter lineups and achieve some interesting results.\n\nRead the write-up [here](presentation/writeup.pdf) for the full details.\n\n### Getting Started\n1. Install the requirements with `pip install -r requirements.txt`\n   - Or manually install PyTorch, CVXPY, Pandas, Matplotlib, blosc2, and tqdm\n2. Fetch the raw data with `raw_data/fetch_data.py`\n3. Process the data with `src/data/data_loading.py`\n4. Try out the zero-sum stochastic game model with `src/policy/optimal_policy.py`\n5. Try the batting lineup optimization scripts with `src/policy/batting_order_optimization.py`\n6. Check out some visualizations with `src/statistics.ipynb` and `src/policy/batting_order.ipnyb`\n7. Feel free to load the data with `bd = BaseballData()` and experiment!\n\n### Project Structure\n- `model_weights/` contains pre-trained models for the distributions\n- `presentation/` contains the research poster and write-up\n- `src/` contains the made codebase\n  - `src/data/` contains the data processing scripts and Pytorch datasets\n  - `src/distributions/` contains the Pytorch models for learning the distributions\n  - `src/model/` contains the object classes for the game model, like players, zones, pitches, etc.\n  - `src/policy/` contains the zero-sum stochastic game model and work on batting lineup optimization\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobona%2Fzerosumbaseball","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbobona%2Fzerosumbaseball","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobona%2Fzerosumbaseball/lists"}