Skip to content

featurebyte.TargetNamespace.create

create(
name: str,
primary_entity: List[str],
dtype: DBVarType,
window: Optional[str]=None,
target_type: Optional[TargetType]=None,
positive_label: Union[str, int, bool, NoneType]=None
) -> TargetNamespace

Description

Create a new TargetNamespace.

Parameters

  • name: str
    Name of the TargetNamespace

  • primary_entity: List[str]
    List of entities.

  • dtype: DBVarType
    Data type of the TargetNamespace

  • window: Optional[str]
    Window of the TargetNamespace

  • target_type: Optional[TargetType]
    Type of the Target used to indicate the modeling type of the target

  • positive_label: Union[str, int, bool, NoneType]
    Positive label value for classification targets. Only applicable when target_type is CLASSIFICATION. The value type must match the dtype (str for VARCHAR/CHAR, int for INT, bool for BOOL).

Returns

  • TargetNamespace
    The created TargetNamespace

Examples

>>> target_namespace = fb.TargetNamespace.create(
...     name="amount_7d_target",
...     window="7d",
...     dtype=DBVarType.FLOAT,
...     primary_entity=["customer"],
...     target_type=fb.TargetType.REGRESSION,
... )
>>> classification_target_namespace = fb.TargetNamespace.create(
...     name="conversion_target",
...     window="7d",
...     dtype=DBVarType.VARCHAR,
...     primary_entity=["customer"],
...     target_type=fb.TargetType.CLASSIFICATION,
...     positive_label="converted",
... )