victormiller commited on
Commit
42102b3
1 Parent(s): f5c7100

Update results.py

Browse files
Files changed (1) hide show
  1. results.py +10 -14
results.py CHANGED
@@ -7,8 +7,6 @@ import pandas as pd
7
  import plotly.express as px
8
 
9
  #Perplexity Across Different Buckets (global)
10
- import plotly.graph_objects as go
11
-
12
  # The data you provided
13
  DATA = [
14
  ["2014", [["1-1", "2-5", "6-10", "11-100", "101-1000", "1001-30000000"], [17.410227605477868, 16.11176217183986, 15.632757662414805, 15.446116676532212, 16.716943171826703, 18.156821563322765]]],
@@ -23,30 +21,28 @@ DATA = [
23
  ["2023", [["1-1", "2-5", "6-10", "11-100", "101-1000", "1001-30000000"], [15.4293630385597, 14.608379914730168, 14.118271697056592, 13.880215644749589, 13.767106666731275, 15.05749135510839]]]
24
  ]
25
 
26
- # Extract years, ranges, and values
27
- years = [year_data[0] for year_data in DATA]
28
  ranges = DATA[0][1][0]
 
29
  all_values = [year_data[1][1] for year_data in DATA]
30
 
31
  # Create the figure
32
  fig = go.Figure()
33
 
34
- # Add a trace for each range category
35
- for i, range_label in enumerate(ranges):
36
- values = [year_values[i] for year_values in all_values]
37
- fig.add_trace(go.Scatter(x=years, y=values, mode='lines+markers', name=range_label))
38
 
39
  # Update layout
40
  fig.update_layout(
41
- title="Values over Time by Category",
42
- xaxis_title="Year",
43
- yaxis_title="Values",
44
- legend_title="Categories",
45
  hovermode="x unified"
46
  )
47
 
48
- # Show the plot
49
-
50
  Perplexity_Across_Different_Buckets_global_graph = fig
51
 
52
 
 
7
  import plotly.express as px
8
 
9
  #Perplexity Across Different Buckets (global)
 
 
10
  # The data you provided
11
  DATA = [
12
  ["2014", [["1-1", "2-5", "6-10", "11-100", "101-1000", "1001-30000000"], [17.410227605477868, 16.11176217183986, 15.632757662414805, 15.446116676532212, 16.716943171826703, 18.156821563322765]]],
 
21
  ["2023", [["1-1", "2-5", "6-10", "11-100", "101-1000", "1001-30000000"], [15.4293630385597, 14.608379914730168, 14.118271697056592, 13.880215644749589, 13.767106666731275, 15.05749135510839]]]
22
  ]
23
 
24
+ # Extract ranges (buckets) and years
 
25
  ranges = DATA[0][1][0]
26
+ years = [year_data[0] for year_data in DATA]
27
  all_values = [year_data[1][1] for year_data in DATA]
28
 
29
  # Create the figure
30
  fig = go.Figure()
31
 
32
+ # Add a trace for each year
33
+ for i, year in enumerate(years):
34
+ values = all_values[i]
35
+ fig.add_trace(go.Scatter(x=ranges, y=values, mode='lines+markers', name=year))
36
 
37
  # Update layout
38
  fig.update_layout(
39
+ title="Perplexity Versus Buckets for Different Years",
40
+ xaxis_title="Buckets",
41
+ yaxis_title="Perplexity",
42
+ legend_title="Years",
43
  hovermode="x unified"
44
  )
45
 
 
 
46
  Perplexity_Across_Different_Buckets_global_graph = fig
47
 
48