RLStatistics-ML is a Python toolkit designed to process Rocket League replay data, extract player and match statistics, and train machine learning models—such as Random Forest classifiers—to predict match outcomes and enhance an in-game plugin’s analytics capabilities.
RLStatistics-ML provides a streamlined pipeline to:
- Parse and clean raw replay JSON files.
- Compute aggregated statistics per player and per match.
- Train and evaluate a Random Forest model for outcome prediction.
- Replay Processing: Load and normalize Rocket League replay data into pandas DataFrames for further analysis.
- Statistical Extraction: Compute key metrics (goals, saves, shots, assists) per player and match.
- Machine Learning Pipeline: Train a Random Forest classifier end-to-end using scikit-learn’s
RandomForestClassifier
for match outcome prediction. - Configurable Workflows: Toggle data processing and model training directly in
main.py
via commenting/uncommenting. - CSV & JSON Outputs: Export processed data and model predictions in both CSV and JSON formats for integration with external tools.
-
Clone the repository
git clone https://github.com/BenjaminDanker/RLStatistics-ML.git cd RLStatistics-ML
-
Create a virtual environment (recommended)
python3 -m venv venv source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
All operations are controlled in main.py
. By commenting or uncommenting the corresponding lines, you can switch between replay processing and model training:
if __name__ == "__main__":
# To process replay files:
# from replay_process import process_replays
# process_replays(input_path="replays_all.json", output_path="replays_processed.csv")
# To train & evaluate the model:
# from train_model import train_and_evaluate
# train_and_evaluate(train_csv="replays_processed.csv", output_json="replays_stats.json")
- Enable replay processing by uncommenting the
process_replays
lines. - Enable model training by uncommenting the
train_and_evaluate
lines. - Run:
python main.py
- Python 3.8+
- pandas: data manipulation and analysis library
- NumPy: numerical computing library
- scikit-learn: machine learning toolkit, used here for Random Forests
- Fork the repo.
- Create a feature branch (
git checkout -b feature/my-feature
). - Commit your changes (
git commit -m "Add new feature"
). - Push to the branch (
git push origin feature/my-feature
). - Open a Pull Request.
This project is licensed under the MIT License.