This project, Valorant Performance Predictor, is a machine learning application designed to predict player performance in Valorant based on a variety of in-game statistics. The prediction is powered by a Gradient Boosting Regressor model trained using scikit-learn.
- Project Overview
- Uses and Scope
- File Structure
- Software and Tools Requirements
- Getting Started
- Data Description
- Usage
- Project Steps
- Future Enhancements
- Hosted Link
- Acknowledgments
Valorant Performance Prediction aims to analyze and model player statistics to predict performance metric win percentage. The project follows a machine learning pipeline, including data ingestion, cleaning, preprocessing, and model training.
The Valorant Performance Prediction project is a powerful tool for Valorant players, offering insights and analysis that can enhance strategic decision-making and gameplay:
- Performance Analysis: Players can input various game statistics and scenarios to analyze potential outcomes, understanding how different factors impact their performance.
- Win Probability Estimation: By providing a predicted win percentage, users can make data-driven decisions about their gameplay, such as agent selection and weapon usage.
- Scenario Simulation: The model allows for the simulation of different in-game situations, helping players experiment with strategies and observe their effects on win probability.
- Community Engagement: Content creators and analysts can use the project to engage the gaming community with data-driven content like match predictions and strategic breakdowns.
- Future Extensions: The project can be extended to include features like real-time data analysis, integration with gaming APIs, or expanded predictive capabilities.
valorant-performance-predictor
│
├── App
│ ├── stream-lit-app.py # Streamlit application script
│ └── preprocessings.py # Preprocessing functions used in Streamlit App
│
├── data
│ └── val_stats.csv # CSV data file with player statistics
│
├── steps
│ ├── data_ingestion.py # Script for loading data
│ ├── data_cleaning.py # Script for cleaning data
│ ├── data_preprocessing.py # Script for data preprocessing
│ └── model_training.py # Script for training and evaluating the model
│
├── label_encoders.pkl # Pickle file for saved label encoders
├── model.pkl # Pickle file for the trained model
├── scaler.pkl # Pickle file for the scaler
└── README.md # Project documentation
- Python: Version 3.7 or higher
- pip: Ensure
pip
is installed for managing project dependencies
-
Clone the repository:
git clone https://github.com/gupta-v/valorant-performance-predict.git
-
Navigate to the project directory:
cd valorant-performance-predict
-
Install the required packages using requirements.txt:
pip install -r requirements.txt
The data used in this project (val_stats.csv) includes various player statistics, such as:
- headshots: Number of headshots
- kills: Number of kills
- deaths: Number of deaths
- assists: Number of assists
- agent_1, agent_2, agent_3: Agents played
- gun1_name, gun1_head, gun1_body: Gun Details
- Additional columns representing performance metrics and weapon usage
- Ensure all dependencies are installed.
- Run train model step of the pipeline using the script provided in the steps folder.
python steps/model_training.py
- The model will be trained and saved in the model.pkl file.
- The scaler and label encoders will be saved in the scaler.pkl and label_encoders.pkl file.
- Navigate to the App directory:
cd App
- Run the Streamlit application using the command:
streamlit run stream-lit-app.py
- The application will be hosted on local server.
- Open your browser and go to http://localhost:8501 to use the web interface.
- Script: data_ingestion.py
- Description: Loads the player statistics data from data/val_stats.csv using pandas and logs the data loading process.
- Script: data_cleaning.py
- Description: Cleans the data by dropping unnecessary columns, filling missing values, and converting data types for numerical processing.
- Script: datapreprocessing.py
- Description: Processes the data by calculating performance ratios, encoding categorical variables, and scaling numerical features. The data is split into training and testing sets.
- Script: model_training.py
- Description: Trains a Gradient Boosting Regressor on the preprocessed data, evaluates its performance using RMSE and R² score, and saves the model, scaler, and encoders.
-
The model's performance was evaluated using the test set, and the results are as follows:
-
Metrics Used:
-
- MSE measures the average squared difference between the predicted and actual values. A lower MSE indicates that the model's predictions are close to the actual values.
-
- RMSE is the square root of MSE and provides the error magnitude in the same units as the target variable. A lower RMSE signifies better model accuracy.
-
- The R² score indicates that the model explains approximately 89.45% of the variance in the target variable, showcasing its strong predictive power.
-
-
The model's performance metrics are automatically evaluated and printed to the console when you run the training script i.e
model_training.py
.
- Incorporate additional features to improve prediction accuracy.
- Experiment with different regression models and hyperparameters.
- Implement cross-validation for better model evaluation.
- Develop a more comprehensive front-end interface.
- The project is hosted on Streamlit Cloud and can be accessed at: https://valorant-performance-prediction-gupta-v.streamlit.app
- Inspired by the exciting gameplay and competitive nature of Valorant.
- Thanks to the open-source community for the tools and libraries used.