Forecasting Outcomes of Major League Baseball Games Using Machine Learning EAS 499 Senior Capstone Thesis University of Pennsylvania An undergraduate thesis submitted in partial fulfillment of the requirements for the Bachelor of Applied Science in Computer and Information Science Andrew Y. Cui1 Thesis Advisor: Dr. Shane T. Jensen2 Faculty Advisor: Dr. Lyle H. Ungar3 April 29, 2020 1 Candidate for Bachelor of Applied Science, Computer and Information Science. Email:
[email protected] 2 Professor of Statistics. Email:
[email protected] 3 Professor of Computer and Information Science. Email:
[email protected] Abstract When two Major League Baseball (MLB) teams meet, what factors determine who will win? This apparently simple classification question, despite the gigabytes of detailed baseball data, has yet to be answered. Published public-domain work, applying models ranging from one-line Bayes classifiers to multi-layer neural nets, have been limited to classification accuracies of 55- 60%. In this paper, we tackle this problem through a mix of new feature engineering and machine learning modeling. Using granular game-level data from Retrosheet and Sean Lahman’s Baseball Database, we construct detailed game-by-game covariates for individual observations that we believe explain greater variance than the aggregate numbers used by existing literature. Our final model is a regularized logistic regression elastic net, with key features being percentage differences in on-base percentage (OBP), rest days, isolated power (ISO), and average baserunners allowed (WHIP) between our home and away teams. Trained on the 2001-2015 seasons and tested on over 9,700 games during the 2016-2019 seasons, our model achieves a classification accuracy of 61.77% and AUC of 0.6706, exceeding or matching the strongest findings in the existing literature, and stronger results peaking at 64-65% accuracy when evaluated monthly.