mrfakename commited on
Commit
b80eb61
1 Parent(s): 2bb5d82

Add threshold

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -92,7 +92,7 @@ def create_db():
92
  def get_data():
93
  conn = get_db()
94
  cursor = conn.cursor()
95
- cursor.execute('SELECT name, upvote, downvote FROM model')
96
  data = cursor.fetchall()
97
  df = pd.DataFrame(data, columns=['name', 'upvote', 'downvote'])
98
  df['name'] = df['name'].replace(model_names)
@@ -110,8 +110,6 @@ def get_data():
110
  actual_b = df['upvote'][j] / df['votes'][j]
111
  df.at[i, 'score'] += 32 * (actual_a - expected_a)
112
  df.at[j, 'score'] += 32 * (actual_b - expected_b)
113
- if df['votes'][j] < 3:
114
- df.at[j, 'score'] -= (3 - df['votes'][j]) * 5
115
  df['score'] = round(df['score'])
116
  ## ELO SCORE
117
 
 
92
  def get_data():
93
  conn = get_db()
94
  cursor = conn.cursor()
95
+ cursor.execute('SELECT name, upvote, downvote FROM model WHERE SUM(upvote, downvote) > 5')
96
  data = cursor.fetchall()
97
  df = pd.DataFrame(data, columns=['name', 'upvote', 'downvote'])
98
  df['name'] = df['name'].replace(model_names)
 
110
  actual_b = df['upvote'][j] / df['votes'][j]
111
  df.at[i, 'score'] += 32 * (actual_a - expected_a)
112
  df.at[j, 'score'] += 32 * (actual_b - expected_b)
 
 
113
  df['score'] = round(df['score'])
114
  ## ELO SCORE
115