This project implements a logistic regression model using PyTorch to predict the outcomes of League of Legends matches. It demonstrates comprehensive data loading, preprocessing, model training, hyperparameter tuning, evaluation, and feature importance analysis.
The dataset used in this project:
- league_of_legends.csv
- Load dataset using
pandas - Split data into training and testing sets (80%-20%)
- Standardize features using
StandardScaler - Convert data into PyTorch tensors
- Define logistic regression model architecture with PyTorch
- Initialize model, loss function (Binary Cross Entropy Loss), and optimizer (Stochastic Gradient Descent)
- Train the logistic regression model for multiple epochs
- Evaluate training performance periodically
- Apply L2 regularization (weight decay) to prevent overfitting
- Retrain the model and evaluate performance improvements
- Compute confusion matrix and classification report
- Plot ROC curve and calculate AUC to assess model quality
- Demonstrate techniques to save (
torch.save) and load (torch.load) PyTorch models - Evaluate the loaded model to confirm consistent performance
- Perform tuning to identify the best learning rate from
[0.01, 0.05, 0.1] - Evaluate test accuracy for each learning rate and select the best
- Extract and visualize model weights to interpret feature significance
pip install pandas scikit-learn torch matplotlibThis project is licensed under the MIT License.