# pyright: basic from __future__ import annotations import numpy as np DEFAULT_BACKENDS = ["ensemble", "bayesian"] DEFAULT_POSITIVE_CLASS_INDEX = 0 DEFAULT_CALIBRATION_BINS = 10 DEFAULT_BAYESIAN_MC_PASSES = 20 DEFAULT_DECISION_THRESHOLD = 0.5 THRESHOLD_START = 0.5 THRESHOLD_STOP = 0.95 THRESHOLD_STEP = 0.05 NOISE_FACTOR_MIN = 0.0 NOISE_FACTOR_MAX = 7.0 NOISE_FACTOR_COUNT = 21 UNCERTAINTY_CUTOFF_COUNT = 21 def threshold_grid() -> np.ndarray: if THRESHOLD_STEP <= 0: raise ValueError("THRESHOLD_STEP must be > 0") if THRESHOLD_STOP < THRESHOLD_START: raise ValueError("THRESHOLD_STOP must be >= THRESHOLD_START") n = int(round((THRESHOLD_STOP - THRESHOLD_START) / THRESHOLD_STEP)) return np.linspace(THRESHOLD_START, THRESHOLD_STOP, num=n + 1, dtype=float) def uncertainty_cutoff_percentiles() -> np.ndarray: return np.linspace(0.0, 100.0, num=UNCERTAINTY_CUTOFF_COUNT, dtype=float) def noise_factor_grid() -> list[float]: factors = np.linspace( NOISE_FACTOR_MIN, NOISE_FACTOR_MAX, num=NOISE_FACTOR_COUNT, dtype=float, ) return [float(v) for v in factors]