GreaterThan#

class deeptrack.features.GreaterThan(value: float | Callable[[...], float] = 0, **kwargs: Dict[str, Any])#

Bases: ArithmeticOperationFeature

Determine whether input is greater than value.

This feature performs element-wise comparison (>) of the input.

Parameters#

valuePropertyLike[int or float], optional

The value to compare (>) with the input. Defaults to 0.

**kwargsAny

Additional keyword arguments passed to the parent constructor.

Example#

In this example, each element in the input array is compared (>) with 2.

Start by creating a pipeline using GreaterThan:

>>> from deeptrack.features import GreaterThan, Value
>>> pipeline = Value([1, 2, 3]) >> GreaterThan(value=2)
>>> pipeline.resolve()
[False False  True]

Equivalently, this pipeline can be created using:

>>> pipeline = Value([1, 2, 3]) > 2
>>> pipeline = 2 > Value([1, 2, 3])  # Different result.

Or, most explicitly:

>>> input_value = Value([1, 2, 3])
>>> gt_feature = GreaterThan(value=2)
>>> pipeline = gt_feature(input_value)