FeatureSpec

Configuration description of features to be queried, which is applicable to the non-automatic graph modification mode.

Parameter

Data Type

Mandatory/Optional

Description

index_key

int/string

Optional

Index key

Default value: value of table_name.

Value range:

  • Int: The value range is [0,255].
  • String: The length range is [1,255].

table_name

string

Optional

Table name

Table name length range: [1, 255]

access_threshold

int

Optional

Feature access threshold.

Value range: [–1, 2147483647]

  • 0: access is enabled. The number of key occurrences in the new batch is not accumulated. The historical feature count is used.
  • Greater than 0: access is enabled. The number of key occurrences in the new batch is accumulated and the feature count record is updated.
  • -1: access is disabled.

eviction_threshold

int

Optional

Feature eviction threshold

Value range: [–1, 2147483647]

  • Greater than or equal to 0: eviction is enabled.
  • -1: eviction is disabled.

If you need to set the feature eviction threshold, you also need to set the feature access threshold.

is_timestamp

bool

Optional

Whether a timestamp used

Value range:

  • True
  • False

batch_size

int

Optional

Batch size of a dataset

Value range: [1, 2147483647]

faae_coefficient

int

Optional

Feature access coefficient

Default value: 1

Value range: [1, 2147483647]

name

string

Mandatory

FeatureSpec name

Value length: [1,255]

Example

1
2
3
4
5
from mx_rec.core.asc.feature_spec import FeatureSpec
feature_spec_list = FeatureSpec("user_ids", table_name="user_table",
                                access_threshold=1,
                                eviction_threshold=1,
                                faae_coefficient=1)