tempor.metrics.metric module¶
Module containing the base class for metrics.
- class tempor.metrics.metric.Metric[source]¶
-
Metric abstract base class, defines the required methods.
The base class that all plugins must inherit from.
- class tempor.metrics.metric.OneOffPredictionMetric[source]¶
Bases:
MetricMetric abstract base class for the one-off prediction task.
The base class that all plugins must inherit from.
- class tempor.metrics.metric.OneOffClassificationMetric[source]¶
Bases:
OneOffPredictionMetricMetric abstract base class for the one-off prediction task, classification case.
The base class that all plugins must inherit from.
- class tempor.metrics.metric.OneOffRegressionMetric[source]¶
Bases:
OneOffPredictionMetricMetric abstract base class for the one-off prediction task, regression case.
The base class that all plugins must inherit from.
- class tempor.metrics.metric.TimeToEventMetric[source]¶
Bases:
MetricMetric abstract base class for the time-to-event (survival) task.
The base class that all plugins must inherit from.
- evaluate(actual: tuple[ndarray, ndarray], predicted: ndarray, horizons: list[float] | list[int] | list[Timestamp], *args: Any, **kwargs: Any) list[float][source]¶
The metric evaluation call.
- Parameters:¶
- actual : metric_typing.EventArrayTimeArray¶
A tuple of two numpy arrays: the event values array and the event times array, for the actual event vales.
- predicted : np.ndarray¶
A numpy array of shape
(n_samples, n_horizons_timesteps, n_features)with the predicted risk estimates.- horizons : data_typing.TimeIndex¶
List of horizons time points.
- *args : Any
Additional positional arguments.
- **kwargs : Any
Additional keyword arguments.
- Returns:¶
The metric values for each horizon time point.
- Return type:¶
List[float]