nick-leland commited on
Commit
db06c26
·
1 Parent(s): fb39151

Adding the test file

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -26,7 +26,9 @@ EXPECTED_COLUMNS.extend([f'winrate_{i}' for i in games_ids])
26
  def load_reference_data(player_id):
27
  """Load reference prediction data for comparison"""
28
  try:
29
- ref_df = pd.read_csv(f"{player_id}.csv")
 
 
30
  return ref_df.iloc[-1][f"{player_id}_S34"]
31
  except Exception as e:
32
  print(f"Could not load reference data: {e}")
@@ -66,7 +68,7 @@ def prepare_single_player_data(user_id, mmr, comf_1, comf_2, comf_3, comf_4, com
66
 
67
  # Get statistics from league data
68
  try:
69
- captains_df = pd.read_csv("S34 Draft Sheet Captains.csv")
70
  bucks_stats = captains_df["Buck's Bucks"].describe()
71
  cents_stats = captains_df["Crub Cents"].describe()
72
 
@@ -145,7 +147,9 @@ def predict_cost(user_id, mmr, comf_1, comf_2, comf_3, comf_4, comf_5):
145
  # Make prediction
146
  input_name = session.get_inputs()[0].name
147
  prediction = session.run(None, {input_name: processed_data.values.astype(np.float32)})[0]
 
148
  predicted_cost = round(float(prediction[0]), 2)
 
149
 
150
  hero_stats = processed_data.iloc[0]
151
  total_games = hero_stats.get('total_games_played', 'N/A')
 
26
  def load_reference_data(player_id):
27
  """Load reference prediction data for comparison"""
28
  try:
29
+ ref_df = pd.read_csv(f"{player_id}.csv", encoding='utf-8')
30
+ print("Reference data columns:", ref_df.columns)
31
+ print("Reference data values:", ref_df.iloc[-1])
32
  return ref_df.iloc[-1][f"{player_id}_S34"]
33
  except Exception as e:
34
  print(f"Could not load reference data: {e}")
 
68
 
69
  # Get statistics from league data
70
  try:
71
+ captains_df = pd.read_csv("S34 Draft Sheet - Captains.csv", encoding='utf-8')
72
  bucks_stats = captains_df["Buck's Bucks"].describe()
73
  cents_stats = captains_df["Crub Cents"].describe()
74
 
 
147
  # Make prediction
148
  input_name = session.get_inputs()[0].name
149
  prediction = session.run(None, {input_name: processed_data.values.astype(np.float32)})[0]
150
+ print("\nPrediction output:", prediction)
151
  predicted_cost = round(float(prediction[0]), 2)
152
+ print("Predicted cost:", predicted_cost)
153
 
154
  hero_stats = processed_data.iloc[0]
155
  total_games = hero_stats.get('total_games_played', 'N/A')