pytorch_forecasting.metrics.
CompositeMetric
Bases: pytorch_lightning.metrics.metric.Metric
pytorch_lightning.metrics.metric.Metric
Metric that combines multiple metrics.
Metric does not have to be called explicitly but is automatically created when adding and multiplying metrics with each other.
Example
composite_metric = SMAPE() + 0.4 * MAE()
metrics (List[LightningMetric], optional) – list of metrics to combine. Defaults to [].
weights (List[float], optional) – list of weights / multipliers for weights. Defaults to 1.0 for all metrics.
Methods
compute()
compute
Get metric
to_prediction(y_pred)
to_prediction
Convert network prediction into a point prediction.
to_quantiles(y_pred)
to_quantiles
Convert network prediction into a quantile prediction.
update(y_pred, y_actual)
update
Update composite metric
metric
torch.Tensor
Will use first metric in metrics attribute to calculate result.
metrics
y_pred – prediction output of network
point prediction
prediction quantiles
y_pred – network output
y_actual – actual values
metric value on which backpropagation can be applied