Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Champion Predictor Model
|
| 2 |
+
|
| 3 |
+
This repository contains the files for an XGBoost-based Champion Predictor model. The model predicts champions based on input features.
|
| 4 |
+
|
| 5 |
+
## Files
|
| 6 |
+
|
| 7 |
+
- **champion_predictor.json**: Serialized XGBoost model saved in JSON format.
|
| 8 |
+
- **label_encoder.joblib**: Label encoder used for encoding and decoding champion names.
|
| 9 |
+
- **training_feature.csv**: Dataset used for training the model.
|
| 10 |
+
|
| 11 |
+
## How to Use
|
| 12 |
+
|
| 13 |
+
1. Clone the repository:
|
| 14 |
+
|
| 15 |
+
```bash
|
| 16 |
+
git clone https://huggingface.co/USERNAME/champion-predictor
|
| 17 |
+
cd champion-predictor
|
| 18 |
+
```
|
| 19 |
+
|
| 20 |
+
2. Load the model in your Python code:
|
| 21 |
+
|
| 22 |
+
```python
|
| 23 |
+
import xgboost as xgb
|
| 24 |
+
import joblib
|
| 25 |
+
import pandas as pd
|
| 26 |
+
|
| 27 |
+
# Load model
|
| 28 |
+
model = xgb.Booster()
|
| 29 |
+
model.load_model("champion_predictor.json")
|
| 30 |
+
|
| 31 |
+
# Load label encoder
|
| 32 |
+
label_encoder = joblib.load("label_encoder.joblib")
|
| 33 |
+
|
| 34 |
+
# Example usage
|
| 35 |
+
input_features = pd.read_csv("training_feature.csv").iloc[0:1, :-1] # Example input
|
| 36 |
+
prediction = model.predict(xgb.DMatrix(input_features))
|
| 37 |
+
predicted_label = label_encoder.inverse_transform([prediction.argmax()])
|
| 38 |
+
print(f"Predicted Champion: {predicted_label[0]}")
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
## Acknowledgments
|
| 42 |
+
|
| 43 |
+
This model was developed as part of the ID2223 Scalable Machine Learning and Deep Learning course.
|