mt_metadata.features.weights.threshold_weight_kernel

Classes

ThresholdWeightKernel

ThresholdWeightKernel

Module Contents

class mt_metadata.features.weights.threshold_weight_kernel.ThresholdWeightKernel(**data)

Bases: mt_metadata.features.weights.taper_monotonic_weight_kernel.TaperMonotonicWeightKernel

ThresholdWeightKernel

A special case of MonotonicWeightKernel where the transition region is a single value, resulting in a hard threshold (step function). This kernel outputs 0 or 1 depending on whether the input is above or below the threshold, according to the threshold_type.

Parameters:
  • threshold (float) – The threshold value.

  • threshold_type (str, optional) – “low cut” (default) or “high cut”. Determines which side is downweighted.

  • **kwargs – Additional keyword arguments passed to MonotonicWeightKernel.

threshold_type: Annotated[str, Field(default='low cut', description='Which side of a threshold should be downweighted.', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['low cut']})]