FloorDivide#

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

Bases: ArithmeticOperationFeature

Divide the input with a value.

This feature performs element-wise floor division (//) of the input.

Floor division produces an integer result when both operands are integers, but truncates towards negative infinity when operands are floating-point numbers.

Parameters#

value: PropertyLike[int or float], optional

The value to floor-divide 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 FloorDivide: >>> pipeline = dt.Value([-3, 3, 6]) >> dt.FloorDivide(value=5) >>> pipeline.resolve() [0.2 0.4 0.6]

Equivalently, this pipeline can be created using: >>> pipeline = dt.Value([-3, 3, 6]) // 5

Which is not equivalent to: >>> pipeline = 5 // dt.Value([-3, 3, 6]) # Different result.

Or, more explicitly: >>> input_value = dt.Value([-3, 3, 6]) >>> floordiv_feature = dt.FloorDivide(value=5) >>> pipeline = feature(floordiv_input_value)