Edit model card
YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

NBA Shots Prediction

The main objective of this project is the prediction of shooting performances of NBA players.

Project Organization

β”œβ”€β”€ data
β”œβ”€β”€ download_data.py
β”œβ”€β”€ LICENSE
β”œβ”€β”€ Notebooks
β”‚   β”œβ”€β”€ Dataframe generation and preparation.ipynb
β”‚   β”œβ”€β”€ Exploratory Data Analysis.ipynb
β”‚   └── Models Training.ipynb
β”œβ”€β”€ README.md
β”œβ”€β”€ References
β”‚   └── Rapport Final.docx
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ streamlit_nba
β”‚   β”œβ”€β”€ app.py
β”‚   β”œβ”€β”€ a_re.png
β”‚   β”œβ”€β”€ assets
β”‚   β”œβ”€β”€ Ballon.png
β”‚   β”œβ”€β”€ github-mark.png
β”‚   β”œβ”€β”€ github-mark-white.png
β”‚   β”œβ”€β”€ gradient_boosting_features.png
β”‚   β”œβ”€β”€ Image panier.png
β”‚   β”œβ”€β”€ __pycache__
β”‚   β”‚   β”œβ”€β”€ config.cpython-310.pyc
β”‚   β”‚   └── member.cpython-310.pyc
β”‚   β”œβ”€β”€ style.css
β”‚   β”œβ”€β”€ tabs
β”‚   β”‚   β”œβ”€β”€ conclusions.py
β”‚   β”‚   β”œβ”€β”€ credits.py
β”‚   β”‚   β”œβ”€β”€ Exploratory_data_analysis.py
β”‚   β”‚   β”œβ”€β”€ intro.py
β”‚   β”‚   β”œβ”€β”€ machine_learning_tab.py
β”‚   β”‚   β”œβ”€β”€ pred_own_shot.py
β”‚   └── XGboost_features.png

About this project

This project focuses on analyzing the shooting performance of players in the National Basketball Association (NBA) using data on shots taken between 1997 and 2020. The main objective is to develop a classification model to predict the probability of a shot being successful. The data includes information such as the location of shots on the court, variables related to shooting actions, and other player characteristics.

The team used various models, including XGBoost, to train the prediction model. The analysis reveals that the model shows variable accuracy depending on the shot class, with better performance in predicting missed shots. The importance of variables, such as action type and shot distance, was examined to interpret the results.

Improvement perspectives were explored, including training individual models for each player, which showed an increase in accuracy. The addition of new variables, such as defender distance and ball possession time, was also considered to enhance the model's performance. Despite challenges related to data availability and computing power constraints, the project resulted in a model capable of reasonably accurately predicting made and missed shots, providing valuable insights into factors influencing outcomes in professional basketball.

We invite you to read the entire report (References/Rapport Final.docx) for more details.


How to use it ?

1 - set the environment

  • Clone the repository

  • Create a virtual environement by running the following command :

    virutalenv venv

    source venv/bin/activate

    pip install -m requirements.txt

2 - Download the data

First solution : download from the script

To automatically download all the datasets and the models you will need to get an access token. Please contact @willymaillot87.

Once you get the token execute the script 'download_data.py'

Second Solution : manually download the datasets and create the models

Download all the necessary CSVs from the following links to the folder 'data'. You may need to create an account to kaggle to download those datasets :

Once you get the datasets just run all the cells from the notebooks:

  1. 'Notebooks/Dataframe generation and preparation.ipynb'
  2. 'Notebooks/Models Training.ipynb'

3 - Run the streamlit app

  • In order to access to the streamlit app please run the following commands :

    cd streamlit_app

    streamlit run app.py

  • Open your browser to this adress :

    localhost:8501

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference API
Unable to determine this model's library. Check the docs .