Jimin Park commited on
Commit
5cd1244
·
1 Parent(s): 97a08ff

kermitting soon

Browse files
Files changed (1) hide show
  1. util/app.py +9 -3
util/app.py CHANGED
@@ -99,17 +99,23 @@ def show_stats(player_opgg_url):
99
  def predict_champion(player_opgg_url, *champions):
100
  """Make prediction based on selected champions"""
101
 
 
 
102
  if not player_opgg_url or None in champions:
103
  return "Please fill in all fields"
104
 
105
  try:
106
  if model is None:
107
  return "Model not loaded properly"
 
 
108
 
109
  features = get_user_training_df(player_opgg_url)
110
- if isinstance(features, str): # Error message
111
- return features
112
-
 
 
113
  prediction = model.predict(features)
114
  predicted_champion = CHAMPIONS[prediction[0]]
115
  return f"Predicted champion: {predicted_champion}"
 
99
  def predict_champion(player_opgg_url, *champions):
100
  """Make prediction based on selected champions"""
101
 
102
+ print("============= Inside predict_champion()=================\n")
103
+
104
  if not player_opgg_url or None in champions:
105
  return "Please fill in all fields"
106
 
107
  try:
108
  if model is None:
109
  return "Model not loaded properly"
110
+
111
+ print("============= Inside predict_champion(): Model loaded properly=================\n")
112
 
113
  features = get_user_training_df(player_opgg_url)
114
+
115
+ print("============= Inside predict_champion(): =================\n")
116
+ print("features type: ", type(features), "\n features: \n", features, "\n")
117
+
118
+ print("Starting model prediction... \n")
119
  prediction = model.predict(features)
120
  predicted_champion = CHAMPIONS[prediction[0]]
121
  return f"Predicted champion: {predicted_champion}"