Downloads · 30 days
0
sunga25/Detecting-Tennis-Anomalies-JEPA
Detecting-Tennis-Anomalies-JEPA is a machine learning model from sunga25. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
This project focuses on analyzing ATP tennis match data using a deep learning model with joint embedding techniques. The objective is to detect anomalies in professional men's tennis tournament draws using advanced st…
Downloads · 30 days
0
Access
Public
Updated Sep 27, 2024
Repo size
—
Likes
1
Public
Click a slice to open those files.
.csv12.1 MB · 97%
From the Hugging Face model README
This project focuses on analyzing ATP tennis match data using a deep learning model with joint embedding techniques. The objective is to detect anomalies in professional men's tennis tournament draws using advanced statistical and machine learning methods. The project employs PyTorch for building and training the neural network, Optuna for hyperparameter optimization, and DBSCAN for anomaly detection.
The project aims to identify irregularities in tennis matches by examining patterns and discrepancies in player rankings, ages, and other match-related features. This analysis can help detect potential biases or unusual outcomes in tournament draws.
Clone the repository:
git clone https://github.com/yourusername/atp-tennis-analysis.git
cd atp-tennis-analysis
pip install -r requirements.txt
Download the ATP match data files and place them in the project directory. Ensure the files are named in the format atp_matches_<year>.csv (e.g., atp_matches_2000.csv).
Run the main script to load data, preprocess it, and train the model: python main.py
The script trains the model using the preprocessed data, optimizing hyperparameters with Optuna, and saves the best-performing model.
The model’s predictions are used to perform anomaly detection, identifying unusual matches or player performances.
Results, including anomaly plots and metrics, will be saved in the output directory. CSV files summarizing the anomalies per player, year, and tournament will also be generated.
The JointEmbeddedModel consists of:
Embeddings for Categorical Features: Each categorical variable (e.g., player IDs, tournament IDs) is embedded into a dense vector.
Fully Connected Layers: These layers combine embeddings and numerical features to predict match outcomes.
Dropout Layers: Used to prevent overfitting and improve model generalization.
The project uses Optuna to automatically search for the best combination of model parameters, including:
Embedding dimension
Hidden layer size
Learning rate
Batch size
Dropout rate
Anomalies are detected by comparing expected and actual rank differences in matches using DBSCAN clustering. Anomalies can indicate unexpected match outcomes, potential biases, or errors in player rankings.
Positive Anomalies: Matches where the predicted rank difference was significantly lower than expected. Negative Anomalies: Matches where the predicted rank difference was significantly higher than expected. The results are visualized using TSNE plots and saved as images and CSV files.
This project is licensed under the MIT License. See the LICENSE file for more details.