This repository contains code for penalty shot prediction using Apollo choice modeling and a web-based R Shiny app for the user interface.
Penalty shot prediction is an essential aspect of soccer analytics. In this repository, we utilize the Apollo choice modeling package to create a model that predicts the outcome of penalty shots based on various factors. The model takes into account player information, shot locations, goalkeeper behavior, and other relevant features to estimate the probability of a successful penalty shot.
- SixAlt.xlsx: Contains the dataset used for modeling penalty shots. The dataset includes information on player IDs, shot locations, shot outcomes among others
- Model_fixed_effects.R: This script includes code to build the Apollo choice model using the penalty shot dataset. forecast_function.R: Contains the forecast function in R
- utils_func.R: Contains certain utility functions useful in the script
- Prediction_app/app.R: This script contains the code to create the interactive R Shiny app.
- Clone the repository to your local machine using the following command:
git clone https://github.com/tayyabrahmani/penalty-shot-prediction.git
- Open RStudio or your preferred R development environment.
- Install the required R packages if not already installed:
install.packages(c("apollo", "shiny", "tidyverse", "fastDummies", "readxl", "dplyr", "shinyjs", "shinythemes"))
- Run the Model_fixed_effects.R to build the Apollo choice model using the provided dataset.
- After the model is built, run the app.R to launch the R Shiny app.
- The Shiny app will provide an interactive interface where you can input player information and shot locations to predict the outcome of a penalty shot.
The R Shiny app can also be accessed online at this link.
We welcome contributions to improve the penalty shot prediction model and the Shiny app. Feel free to submit issues, open pull requests, or suggest enhancements.
This project was developed by Tayyab, Nallaperumal, Kanthi and Diksha. If you have any questions or need further information, please feel free to contact me.
Enjoy predicting penalty shots like never before with Apollo choice modeling and the R Shiny app!