agh123 commited on
Commit
280e437
Β·
1 Parent(s): 233c808

chore: minor updates

Browse files
Files changed (2) hide show
  1. src/app.py +5 -5
  2. src/components/visualizations.py +7 -6
src/app.py CHANGED
@@ -61,7 +61,7 @@ def render_performance_metrics(metrics: Dict[str, Any]):
61
  col1, col2, col3, col4, col5 = st.columns(5)
62
 
63
  with col1:
64
- st.metric("Top Device", metrics["top_device"])
65
  with col2:
66
  st.metric("Top Score", f"{metrics['top_score']:.1f}")
67
  with col3:
@@ -154,13 +154,13 @@ async def main():
154
 
155
  with tab1:
156
  # Device rankings view
157
- st.title("πŸ† Device Rankings")
158
 
159
  # Show standardization notice
160
- st.info(
161
- f"πŸ“Š Rankings are based on benchmarks with standard conditions: "
 
162
  f"PP={512} tokens, TG={128} tokens. "
163
- f"The rankings are based on the Glicko-2 algorithm."
164
  )
165
 
166
  # Render performance metrics
 
61
  col1, col2, col3, col4, col5 = st.columns(5)
62
 
63
  with col1:
64
+ st.metric("πŸ† Top Device", metrics["top_device"])
65
  with col2:
66
  st.metric("Top Score", f"{metrics['top_score']:.1f}")
67
  with col3:
 
154
 
155
  with tab1:
156
  # Device rankings view
157
+ st.title(" Device Rankings")
158
 
159
  # Show standardization notice
160
+ st.text(
161
+ f"πŸ“Š The rankings are based on the Glicko-2 algorithm."
162
+ f" Rankings are based on benchmarks with standard conditions: "
163
  f"PP={512} tokens, TG={128} tokens. "
 
164
  )
165
 
166
  # Render performance metrics
src/components/visualizations.py CHANGED
@@ -381,7 +381,7 @@ def create_device_radar_chart(g2_confident_display: pd.DataFrame, top_n: int = 1
381
  return fig
382
 
383
 
384
- def create_ranking_ladder(g2_confident_display: pd.DataFrame, top_n: int = 20):
385
  """Create a ranking ladder visualization showing device positions and confidence intervals."""
386
  # Select top N devices
387
  top_devices = g2_confident_display.nlargest(top_n, "Rating").copy()
@@ -445,7 +445,7 @@ def create_ranking_ladder(g2_confident_display: pd.DataFrame, top_n: int = 20):
445
  fig.update_layout(
446
  title=dict(
447
  text=f"Device Ranking Ladder (Top {top_n})",
448
- x=0.5,
449
  y=0.95,
450
  font=dict(size=16, family="Arial, sans-serif", color="rgba(0,0,0,1.0)"),
451
  ),
@@ -481,11 +481,12 @@ def create_ranking_ladder(g2_confident_display: pd.DataFrame, top_n: int = 20):
481
  x=1,
482
  font=dict(size=12, family="Arial, sans-serif", color="rgba(0,0,0,1.0)"),
483
  ),
484
- margin=dict(t=100, l=50, r=200, b=50),
485
  height=800,
486
  hovermode="closest",
487
  paper_bgcolor="rgba(255,255,255,1)", # Pure white background
488
  plot_bgcolor="rgba(255,255,255,1)", # Pure white plot area
 
489
  )
490
 
491
  return fig
@@ -507,7 +508,7 @@ def render_device_rankings(df: pd.DataFrame):
507
  )
508
 
509
  # Display performance overview
510
- st.subheader("πŸ† Performance Overview")
511
 
512
  # Get top device from Glicko-2 rankings
513
  top_device = g2_confident.index[0] if not g2_confident.empty else "N/A"
@@ -522,7 +523,7 @@ def render_device_rankings(df: pd.DataFrame):
522
  # Display metrics in columns
523
  col1, col2, col3 = st.columns([3, 1, 1])
524
  with col1:
525
- st.metric("Top Device", top_device_clean)
526
  with col2:
527
  st.metric("Total Devices", total_devices)
528
  with col3:
@@ -532,7 +533,7 @@ def render_device_rankings(df: pd.DataFrame):
532
 
533
  # Display confident rankings
534
  if not g2_confident.empty:
535
- st.subheader("πŸ“± Device Rankings")
536
 
537
  # Create a copy and handle the index
538
  g2_confident_display = g2_confident.copy()
 
381
  return fig
382
 
383
 
384
+ def create_ranking_ladder(g2_confident_display: pd.DataFrame, top_n: int = 30):
385
  """Create a ranking ladder visualization showing device positions and confidence intervals."""
386
  # Select top N devices
387
  top_devices = g2_confident_display.nlargest(top_n, "Rating").copy()
 
445
  fig.update_layout(
446
  title=dict(
447
  text=f"Device Ranking Ladder (Top {top_n})",
448
+ x=0.4,
449
  y=0.95,
450
  font=dict(size=16, family="Arial, sans-serif", color="rgba(0,0,0,1.0)"),
451
  ),
 
481
  x=1,
482
  font=dict(size=12, family="Arial, sans-serif", color="rgba(0,0,0,1.0)"),
483
  ),
484
+ margin=dict(t=100, l=50, r=100, b=50), # Reduced right margin from 200 to 100
485
  height=800,
486
  hovermode="closest",
487
  paper_bgcolor="rgba(255,255,255,1)", # Pure white background
488
  plot_bgcolor="rgba(255,255,255,1)", # Pure white plot area
489
+ autosize=True, # Enable responsive sizing
490
  )
491
 
492
  return fig
 
508
  )
509
 
510
  # Display performance overview
511
+ # st.subheader("πŸ† Performance Overview")
512
 
513
  # Get top device from Glicko-2 rankings
514
  top_device = g2_confident.index[0] if not g2_confident.empty else "N/A"
 
523
  # Display metrics in columns
524
  col1, col2, col3 = st.columns([3, 1, 1])
525
  with col1:
526
+ st.metric("πŸ† Top Device", top_device_clean)
527
  with col2:
528
  st.metric("Total Devices", total_devices)
529
  with col3:
 
533
 
534
  # Display confident rankings
535
  if not g2_confident.empty:
536
+ # st.subheader("πŸ“± Device Rankings")
537
 
538
  # Create a copy and handle the index
539
  g2_confident_display = g2_confident.copy()