Spaces:
Sleeping
Sleeping
Jimin Park
commited on
Commit
·
b68e73c
1
Parent(s):
022506c
kermitting soon
Browse files- util/app.py +7 -8
util/app.py
CHANGED
@@ -1,19 +1,13 @@
|
|
1 |
# app.py
|
2 |
import gradio as gr
|
3 |
import xgboost as xgb
|
|
|
4 |
from huggingface_hub import hf_hub_download
|
5 |
from app_training_df_getter import create_app_user_training_df
|
6 |
import pandas as pd
|
7 |
-
|
8 |
-
from collections import Counter
|
9 |
-
import os
|
10 |
-
from sklearn.model_selection import train_test_split, GridSearchCV
|
11 |
from sklearn.preprocessing import LabelEncoder
|
12 |
-
from sklearn.metrics import classification_report, precision_score, recall_score, f1_score
|
13 |
-
from xgboost import XGBClassifier, plot_importance
|
14 |
-
import xgboost as xgb
|
15 |
from helper import *
|
16 |
-
import helper as helpfun
|
17 |
|
18 |
|
19 |
# Define champion list for dropdowns
|
@@ -238,6 +232,11 @@ def predict_champion(player_opgg_url, *champions):
|
|
238 |
)
|
239 |
print("type(X_test): ", type(X_test), "\n")
|
240 |
|
|
|
|
|
|
|
|
|
|
|
241 |
print("Starting model prediction... \n")
|
242 |
|
243 |
prediction = model.predict(X_test)
|
|
|
1 |
# app.py
|
2 |
import gradio as gr
|
3 |
import xgboost as xgb
|
4 |
+
from xgboost import DMatrix
|
5 |
from huggingface_hub import hf_hub_download
|
6 |
from app_training_df_getter import create_app_user_training_df
|
7 |
import pandas as pd
|
8 |
+
from sklearn.model_selection import train_test_split
|
|
|
|
|
|
|
9 |
from sklearn.preprocessing import LabelEncoder
|
|
|
|
|
|
|
10 |
from helper import *
|
|
|
11 |
|
12 |
|
13 |
# Define champion list for dropdowns
|
|
|
232 |
)
|
233 |
print("type(X_test): ", type(X_test), "\n")
|
234 |
|
235 |
+
# Convert Pandas DataFrame to DMatrix
|
236 |
+
X_test = DMatrix(X_test)
|
237 |
+
|
238 |
+
print("type(X_test) after converting to DMatrix: ", type(X_test), "\n")
|
239 |
+
|
240 |
print("Starting model prediction... \n")
|
241 |
|
242 |
prediction = model.predict(X_test)
|