LessThanOrEquals#
- class deeptrack.features.LessThanOrEquals(value: float | Callable[[...], float] = 0, **kwargs: dict[str, Any])#
Bases:
ArithmeticOperationFeatureDetermine whether input is less than or equal to value.
This feature performs element-wise comparison (<=) of the input.
Parameters#
- value: PropertyLike[int or float], optional
The value to compare (<=) with the input. Defaults to 0.
- **kwargs: Any
Additional keyword arguments passed to the parent constructor.
Examples#
>>> import deeptrack as dt
Start by creating a pipeline using LessThanOrEquals: >>> pipeline = dt.Value([1, 2, 3]) >> dt.LessThanOrEquals(value=2) >>> pipeline.resolve() [True True False]
Equivalently, this pipeline can be created using: >>> pipeline = dt.Value([1, 2, 3]) <= 2
Which is not equivalent to: >>> pipeline = 2 <= dt.Value([1, 2, 3]) # Different result.
Or, more explicitly: >>> input_value = dt.Value([1, 2, 3]) >>> le_feature = dt.LessThanOrEquals(value=2) >>> pipeline = le_feature(input_value)