fss¶
Import path: earth2studio.statistics.fss
Documentation¶
Statistic for calculating the fractions skill score (FSS) of one tensors with respect to another over a set of given dimensions.
If ensemble_dimension is provided, computes the probabilistic FSS as defined by
Necker et al. (2024): doi.org/10.1002/qj.4824.
Parameters:
-
reduction_dimensions(list[str]) –A list of names corresponding to dimensions to perform the statistical reduction over. Example: ['lat', 'lon']
-
window_sizes(ArrayLike) –A list of the window sizes (in pixels) applied when calculating FSS.
-
thresholds(ArrayLike) –A list of the thresholds applied when calculating FSS.
-
spatial_dimensions(tuple[str, str] | None, default:None) –Indicates the spatial dimensions. If None, it is assumed that these are the last two dimensions.
-
ensemble_dimension(str | None, default:None) –Ensemble dimension for computation of probabilistic FSS. If None (default), forecast is interpreted as deterministic.
-
batch_update(bool, default:False) –Whether to apply batch updates to the FSS with each invocation of call. This is particularly useful when data is recieved in a stream of batches. Each invocation of call will return the running FSS.
__call__ ¶
__call__(
x: Tensor,
x_coords: CoordSystem,
y: Tensor,
y_coords: CoordSystem,
) -> tuple[Tensor, CoordSystem]
Apply metric to data x and y, checking that their coordinates
are broadcastable. While reducing over reduction_dims.
Parameters:
-
x(Tensor) –Input tensor, typically the forecast or prediction tensor.
-
x_coords(CoordSystem) –Ordered dict representing coordinate system that describes the
xtensor.reduction_dimensionsmust be in x_coords, as doensemble_dimensionandspatial_dimensionsif provided in constructor. -
y(Tensor) –Input tensor #2 intended to be used as validation data..
-
y_coords(CoordSystem) –Ordered dict representing coordinate system that describes the
ytensor.reduction_dimensionsmust be in y_coords, dospatial_dimensionsif provided in constructor.
Returns: