Skip to content

featurebyte.ObservationTable.create_observation_table

create_observation_table(
name: str,
sample_rows: Optional[int]=None,
sample_from_timestamp: Union[datetime, str, NoneType]=None,
sample_to_timestamp: Union[datetime, str, NoneType]=None,
downsampling_info: Optional[DownSamplingInfo]=None
) -> ObservationTable

Description

Creates an ObservationTable from an existing ObservationTable.

Parameters

  • name: str
    Observation table name.

  • sample_rows: Optional[int]
    Optionally sample the source observation table to this number of rows before creating the observation table.

  • sample_from_timestamp: Union[datetime, str, NoneType]
    Start of date range to sample from.

  • sample_to_timestamp: Union[datetime, str, NoneType]
    End of date range to sample from.

  • downsampling_info: Optional[DownSamplingInfo]
    Downsampling information to apply when creating the observation table. If provided,

Returns

  • ObservationTable

Examples

>>> observation_table = catalog.get_observation_table("observation_table")
>>> sampled_observation_table = (
...     observation_table.create_observation_table(
...         name="<observation_table_name>",
...         sample_rows=desired_sample_size,
...     )
... )

Create negative downsampled observation table

>>> neg_downsampled_observation_table = (
...     observation_table.create_observation_table(
...         name="<observation_table_name>",
...         downsampling_info=DownSamplingInfo(
...             sampling_rate_per_target_value=[
...                 TargetValueSamplingRate(target_value=0, rate=0.5)
...             ],
...         ),
...     )
... )