Skip to content

Commit 83a4f62

Browse files
committed
Add fixed-time horizon table to performance demo
1 parent f0641e1 commit 83a4f62

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

‎examples/performance_table_demo.py‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
def _():
99
import marimo as mo
1010
import numpy as np
11-
from rtichoke import create_performance_table
11+
from rtichoke import create_performance_table, create_performance_table_times
1212

13-
return create_performance_table, mo, np
13+
return create_performance_table, create_performance_table_times, mo, np
1414

1515

1616
@app.cell
@@ -69,6 +69,29 @@ def _(create_performance_table, mo, model_a, model_b, reals):
6969
return
7070

7171

72+
@app.cell
73+
def _(np):
74+
time_probs = {
75+
"Model A": np.array([0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00])
76+
}
77+
time_reals = np.array([0, 0, 0, 0, 1, 1, 1, 1, 1, 1])
78+
times = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
79+
return time_probs, time_reals, times
80+
81+
82+
@app.cell
83+
def _(create_performance_table_times, mo, time_probs, time_reals, times):
84+
mo.md("## Fixed time horizons — 5 and 10")
85+
create_performance_table_times(
86+
probs=time_probs,
87+
reals=time_reals,
88+
times=times,
89+
fixed_time_horizons=[5, 10],
90+
by=0.10,
91+
)
92+
return
93+
94+
7295
@app.cell
7396
def _(mo):
7497
mo.md(

0 commit comments

Comments
 (0)