Spaces:
Running
Running
victormiller
commited on
Commit
•
42102b3
1
Parent(s):
f5c7100
Update results.py
Browse files- 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
|
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
|
35 |
-
for i,
|
36 |
-
values = [
|
37 |
-
fig.add_trace(go.Scatter(x=
|
38 |
|
39 |
# Update layout
|
40 |
fig.update_layout(
|
41 |
-
title="
|
42 |
-
xaxis_title="
|
43 |
-
yaxis_title="
|
44 |
-
legend_title="
|
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 |
|