Spaces:
Sleeping
Sleeping
Jimin Park
commited on
Commit
·
fbb9338
1
Parent(s):
628884f
kermitting soon
Browse files- util/app.py +3 -3
- util/app_training_df_getter.py +2 -2
- util/helper.py +2 -2
util/app.py
CHANGED
@@ -134,10 +134,10 @@ def predict_champion(player_opgg_url, *champions):
|
|
134 |
|
135 |
training_df = convert_df(training_df)
|
136 |
#print("type(training_df): ", type(training_df), "\n")
|
137 |
-
print("check_datatypes(training_df) BEFORE feature eng
|
138 |
|
139 |
training_df = apply_feature_engineering(training_df)
|
140 |
-
print("check_datatypes(training_df) AFTER feature eng
|
141 |
|
142 |
# Get feature columns
|
143 |
feature_columns = [col for col in training_df.columns
|
@@ -182,7 +182,7 @@ def predict_champion(player_opgg_url, *champions):
|
|
182 |
|
183 |
print(f"Mapped to champion: {predicted_champion}")
|
184 |
|
185 |
-
return f"
|
186 |
|
187 |
except Exception as e:
|
188 |
print(f"Error mapping champion ID: {e}")
|
|
|
134 |
|
135 |
training_df = convert_df(training_df)
|
136 |
#print("type(training_df): ", type(training_df), "\n")
|
137 |
+
print("check_datatypes(training_df) BEFORE feature eng: \n", check_datatypes(training_df), "\n")
|
138 |
|
139 |
training_df = apply_feature_engineering(training_df)
|
140 |
+
print("check_datatypes(training_df) AFTER feature eng: \n", check_datatypes(training_df), "\n")
|
141 |
|
142 |
# Get feature columns
|
143 |
feature_columns = [col for col in training_df.columns
|
|
|
182 |
|
183 |
print(f"Mapped to champion: {predicted_champion}")
|
184 |
|
185 |
+
return f"{predicted_champion}"
|
186 |
|
187 |
except Exception as e:
|
188 |
print(f"Error mapping champion ID: {e}")
|
util/app_training_df_getter.py
CHANGED
@@ -354,8 +354,8 @@ def create_champion_features_and_return_df(merged_player_stats=None, meta_stats=
|
|
354 |
|
355 |
def create_app_user_training_df(url):
|
356 |
try:
|
357 |
-
|
358 |
-
|
359 |
|
360 |
# Input validation
|
361 |
if not url or not isinstance(url, str):
|
|
|
354 |
|
355 |
def create_app_user_training_df(url):
|
356 |
try:
|
357 |
+
meta_stats = get_meta_stats()
|
358 |
+
weekly_meta_stats = get_weekly_meta()
|
359 |
|
360 |
# Input validation
|
361 |
if not url or not isinstance(url, str):
|
util/helper.py
CHANGED
@@ -999,8 +999,8 @@ def calculate_champion_loyalty(df):
|
|
999 |
for i in range(1, 3)) # Only top 2
|
1000 |
confidence_score += min(0.1, recent_games / 100)
|
1001 |
|
1002 |
-
|
1003 |
-
|
1004 |
return {
|
1005 |
'loyalty_score': round(min(loyalty_score, 1.0), 3),
|
1006 |
'confidence_score': round(min(confidence_score, 1.0), 3),
|
|
|
999 |
for i in range(1, 3)) # Only top 2
|
1000 |
confidence_score += min(0.1, recent_games / 100)
|
1001 |
|
1002 |
+
print(f"loyalty_score, confidence score: [{loyalty_score}], [{confidence_score}] \n")
|
1003 |
+
print("===================== exiting: get_loyalty_scores()===================")
|
1004 |
return {
|
1005 |
'loyalty_score': round(min(loyalty_score, 1.0), 3),
|
1006 |
'confidence_score': round(min(confidence_score, 1.0), 3),
|