hyped.core.ops.common module¶
This module defines a collection of data processors for common feature operations.
- class hyped.core.ops.common.Eq(*args: Any, **kwargs: Any)[source]¶
Bases:
BaseDataProcessor[EqConfig]Data processor for checking equality between two feature values.
- process(ctx: ~hyped.core.nodes.base.RunContext, a: ~hyped.core.ops.common.Annotated[~hyped.core.ops.common.T, ~hyped.core.features.validators.MatchFeatures(func=~hyped.core.features.validators.FeatureValidator.__init__.<locals>.wrapped_validator)], b: ~hyped.core.ops.common.Annotated[~hyped.core.ops.common.T, ~hyped.core.features.validators.MatchFeatures(func=~hyped.core.features.validators.FeatureValidator.__init__.<locals>.wrapped_validator)]) BoolFeature | bool | list[bool] | BooleanScalar | BooleanArray[source]¶
Computes whether two feature values are equal.
- Parameters:
ctx (RunContext) – The execution context.
a (T) – The first feature value.
b (T) – The second feature value.
- Returns:
Trueif the feature values are equal, otherwiseFalse.- Return type:
- class hyped.core.ops.common.EqConfig[source]¶
Bases:
BaseDataProcessorConfigConfiguration for the
Eqprocessor.- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_default': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hyped.core.ops.common.GlobalFilter(*args: Any, **kwargs: Any)[source]¶
Bases:
BaseDataAugmentor[GlobalFilterConfig]Data augmentor for filtering values based on a condition.
This processor filters input values using a specified boolean condition, returning the filtered values along with their trace indices.
- process(ctx: RunContext, value: T, condition: BoolFeature | bool | list[bool] | BooleanScalar | BooleanArray) tuple[T, list[int]][source]¶
Filters input values based on a boolean condition.
- Parameters:
ctx (RunContext) – The execution context.
value (T) – The input values to filter.
condition (Bool) – A boolean array indicating which elements to retain.
- Returns:
The filtered values that satisfy the condition.
The indices of the filtered values in the original array.
- Return type:
- class hyped.core.ops.common.GlobalFilterConfig[source]¶
Bases:
BaseDataAugmentorConfigConfiguration for the
GlobalFilteraugmentor.- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_default': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hyped.core.ops.common.NotEq(*args: Any, **kwargs: Any)[source]¶
Bases:
BaseDataProcessor[NotEqConfig]Data processor for checking inverse equality between two feature values.
- process(ctx: ~hyped.core.nodes.base.RunContext, a: ~hyped.core.ops.common.Annotated[~hyped.core.ops.common.T, ~hyped.core.features.validators.MatchFeatures(func=~hyped.core.features.validators.FeatureValidator.__init__.<locals>.wrapped_validator)], b: ~hyped.core.ops.common.Annotated[~hyped.core.ops.common.T, ~hyped.core.features.validators.MatchFeatures(func=~hyped.core.features.validators.FeatureValidator.__init__.<locals>.wrapped_validator)]) BoolFeature | bool | list[bool] | BooleanScalar | BooleanArray[source]¶
Computes whether two feature values are not equal.
- Parameters:
ctx (RunContext) – The execution context.
a (T) – The first feature value.
b (T) – The second feature value.
- Returns:
Falseif the feature values are equal, otherwiseTrue.- Return type:
- class hyped.core.ops.common.NotEqConfig[source]¶
Bases:
BaseDataProcessorConfigConfiguration for the
NotEqprocessor.- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_default': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- hyped.core.ops.common.filter_(value: T, condition: BoolFeature | bool | list[bool] | BooleanScalar | BooleanArray) T[source]¶
Filters input values based on a boolean condition using the
GlobalFilteraugmentor.