tempor.benchmarks.utils module

Any utilities for the benchmark package directory.

tempor.benchmarks.utils.generate_score(metric: ndarray) tuple[float, float][source]

Return score as mean and confidence interval using the 1.96 rule: (mean, 1.96 * std / sqrt(n)). See e.g. https://math.stackexchange.com/a/1572814.

Parameters:
metric : np.ndarray

Input metric.

Returns:

The score as (mean, confidence interval).

Return type:

Tuple[float, float]

tempor.benchmarks.utils.print_score(score: tuple[float, float]) str[source]

Print score as mean +/- range (3 decimal places).

Parameters:
score : Tuple[float, float]

The score to print as (mean, range).

Returns:

The formatted string.

Return type:

str