abacusai.api_class.feature_group — AbacusAI documentation

# abacusai.api_class.feature_group

## Classes

`ApiClass` | Helper class that provides a standard way to create an ABC using
`_ApiClassFactory` | Helper class that provides a standard way to create an ABC using
`SamplingConfig` | An abstract class for the sampling config of a feature group
`NSamplingConfig` | The number of distinct values of the key columns to include in the sample, or number of rows if key columns not specified.
`PercentSamplingConfig` | The fraction of distinct values of the feature group to include in the sample.
`_SamplingConfigFactory` | Helper class that provides a standard way to create an ABC using
`MergeConfig` | An abstract class for the merge config of a feature group
`LastNMergeConfig` | Merge LAST N chunks/versions of an incremental dataset.
`TimeWindowMergeConfig` | Merge rows within a given timewindow of the most recent timestamp
`_MergeConfigFactory` | Helper class that provides a standard way to create an ABC using

## Module Contents

class abacusai.api_class.feature_group.ApiClass

  Bases: `abc.ABC`

  Helper class that provides a standard way to create an ABC using inheritance.

  _upper_snake_case_keys: bool
  _support_kwargs: bool
  __post_init__()
  classmethod _get_builder()
  __str__()

    Return str(self).

  _repr_html_()
  __getitem__(item)
    Parameters:

      item (str)

  __setitem__(item, value)
    Parameters:

      - item (str)

      - value (Any)

  _unset_item(item)
    Parameters:

      item (str)

  get(item, default=None)
    Parameters:

      - item (str)

      - default (Any)

  pop(item, default=NotImplemented)
    Parameters:

      - item (str)

      - default (Any)

  to_dict()

    Standardizes converting an ApiClass to dictionary. Keys of response dictionary are converted to camel case. This also validates the fields ( type, value, etc ) received in the dictionary.

  classmethod from_dict(input_dict)
    Parameters:

      input_dict (dict)

class abacusai.api_class.feature_group._ApiClassFactory

  Bases: `abc.ABC`

  Helper class that provides a standard way to create an ABC using inheritance.

  config_abstract_class = None
  config_class_key = None
  config_class_map
  classmethod from_dict(config)
    Parameters:

      config (dict)

    Return type:

      ApiClass

class abacusai.api_class.feature_group.SamplingConfig

  Bases: `abacusai.api_class.abstract.ApiClass`

  An abstract class for the sampling config of a feature group

  sampling_method: abacusai.api_class.enums.SamplingMethodType
  classmethod _get_builder()
  __post_init__()

class abacusai.api_class.feature_group.NSamplingConfig

  Bases: `SamplingConfig`

  The number of distinct values of the key columns to include in the sample, or number of rows if key columns not specified.

  Parameters:

    - sampling_method (SamplingMethodType) – N_SAMPLING

    - sample_count (int) – The number of rows to include in the sample

    - key_columns (List[str]) – The feature(s) to use as the key(s) when sampling

  sample_count: int
  key_columns: List[str]
  __post_init__()

class abacusai.api_class.feature_group.PercentSamplingConfig

  Bases: `SamplingConfig`

  The fraction of distinct values of the feature group to include in the sample.

  Parameters:

    - sampling_method (SamplingMethodType) – PERCENT_SAMPLING

    - sample_percent (float) – The percentage of the rows to sample

    - key_columns (List[str]) – The feature(s) to use as the key(s) when sampling

  sample_percent: float
  key_columns: List[str]
  __post_init__()

class abacusai.api_class.feature_group._SamplingConfigFactory

  Bases: `abacusai.api_class.abstract._ApiClassFactory`

  Helper class that provides a standard way to create an ABC using inheritance.

  config_class_key = 'sampling_method'
  config_abstract_class
  config_class_map

class abacusai.api_class.feature_group.MergeConfig

  Bases: `abacusai.api_class.abstract.ApiClass`

  An abstract class for the merge config of a feature group

  merge_mode: abacusai.api_class.enums.MergeMode
  classmethod _get_builder()
  __post_init__()

class abacusai.api_class.feature_group.LastNMergeConfig

  Bases: `MergeConfig`

  Merge LAST N chunks/versions of an incremental dataset.

  Parameters:

    - merge_mode (MergeMode) – LAST_N

    - num_versions (int) – The number of versions to merge. num_versions == 0 means merge all versions.

    - include_version_timestamp_column (bool) – If set, include a column with the creation timestamp of source FG versions.

  num_versions: int
  include_version_timestamp_column: bool
  __post_init__()

class abacusai.api_class.feature_group.TimeWindowMergeConfig

  Bases: `MergeConfig`

  Merge rows within a given timewindow of the most recent timestamp

  Parameters:

    - merge_mode (MergeMode) – TIME_WINDOW

    - feature_name (str) – Time based column to index on

    - time_window_size_ms (int) – Range of merged rows will be [MAX_TIME - time_window_size_ms, MAX_TIME]

    - include_version_timestamp_column (bool) – If set, include a column with the creation timestamp of source FG versions.

  feature_name: str
  time_window_size_ms: int
  include_version_timestamp_column: bool
  __post_init__()

class abacusai.api_class.feature_group._MergeConfigFactory

  Bases: `abacusai.api_class.abstract._ApiClassFactory`

  Helper class that provides a standard way to create an ABC using inheritance.

  config_class_key = 'merge_mode'
  config_abstract_class
  config_class_map