Skip to content

Commit 7bd9727

Browse files
committed
Normalize times for performance table times
1 parent 83a4f62 commit 7bd9727

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎src/rtichoke/performance_table.py‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,21 @@ def create_performance_table_times(
100100
Numerical results come from ``prepare_performance_data_times()``. The table
101101
keeps time horizon and censoring/competing-event heuristics visible so that
102102
multiple requested evaluation scenarios are not collapsed in presentation.
103-
Integer horizon values are normalized to floats to match the time-dependent
104-
performance pipeline's join-key schema.
103+
Observed times and fixed horizons are normalized to floats to match the
104+
time-dependent performance pipeline's join-key schema.
105105
"""
106106
normalized_horizons = [float(horizon) for horizon in fixed_time_horizons]
107+
if isinstance(times, dict):
108+
normalized_times = {
109+
key: np.asarray(value, dtype=float) for key, value in times.items()
110+
}
111+
else:
112+
normalized_times = np.asarray(times, dtype=float)
113+
107114
performance_data = prepare_performance_data_times(
108115
probs=probs,
109116
reals=reals,
110-
times=times,
117+
times=normalized_times,
111118
fixed_time_horizons=normalized_horizons,
112119
heuristics_sets=heuristics_sets,
113120
by=by,

0 commit comments

Comments
 (0)