SampleWeighter#
- class openstef_beam.metrics.metrics_helpers.SampleWeighter(*, a_min: float = 0.1, a_max: float = 1.0, exponent: float = 1.0)[source]
Bases:
BaseConfigWeights samples by their magnitude relative to a scale, clipped to
[a_min, a_max].- a_min: float
- a_max: float
- exponent: float
- calculate_weights(values: NDArray[floating], scale: float | NDArray[floating]) NDArray[floating][source]
Calculate weights for
valuesgiven a scalar or per-samplescale.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': False, 'extra': 'ignore', 'protected_namespaces': ()}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].