Skip to content

featurebyte.DisguisedValueImputation

class DisguisedValueImputation(
*,
imputed_value: Union[StrictInt, StrictFloat, StrictStr, bool, NoneType]=None,
type: Literal["disguised"]="disguised",
disguised_values: Sequence[Union[StrictInt, StrictFloat, StrictStr, bool, NoneType]]
)

Description

DisguisedValueImputation class is used to declare the operation to impute the disguised value of a table column. If the imputed_value parameter is None, the values to impute are replaced by missing values and the corresponding rows are ignored during aggregation operations.

Parameters

  • imputed_value: Union[StrictInt, StrictFloat, StrictStr, bool, NoneType]
    The value that will be used to replace any element that matches one of the values in the disguised_values list.

  • type: Literal["disguised"]
    default: "disguised"


  • disguised_values: Sequence[Union[StrictInt, StrictFloat, StrictStr, bool, NoneType]]
    List of values that need to be replaced.

Examples

Create an imputation rule to replace -999 with 0

>>> fb.DisguisedValueImputation(disguised_values=[-999], imputed_value=0)

Create an imputation rule to treat -1 and -96 as missing
>>> fb.DisguisedValueImputation(disguised_values=[-1, -96], imputed_value=None)