Skip to content

featurebyte.Catalog.get_feature

get_feature(
name: str,
version: Optional[str]=None,
context: Optional[str]=None,
use_case: Optional[str]=None
) -> Feature

Description

Gets a Feature object from the catalog using the feature's name and optionally its version name. If no version name is provided, the default version of the feature is returned.

The Feature object includes the logical plan for computing the feature and can be used to create a FeatureList object for training and predicting machine learning models for a specific use case.

Parameters

  • name: str
    Feature name.

  • version: Optional[str]
    Feature version. If None is provided, the default version will be returned.

  • context: Optional[str]
    Name of context used to filter results. If provided, results include both regular features and features specific to that context. If not provided, context-specific features
    (e.g. from user-provided columns) are excluded.

  • use_case: Optional[str]
    Name of use case used to filter results. The context associated with the use case will be used for filtering. Cannot be specified together with context.

Returns

  • Feature
    Feature object.

Examples

Get a default version of a feature by its name space.

>>> feature = catalog.get_feature("InvoiceAmountAvg_60days")

Get a specific version of a feature by specifying its version name.
>>> feature = catalog.get_feature(
...   "InvoiceAmountAvg_60days", version=<version_name>
... )