Global Feature Files

A global feature file is required by Feature Engineering, Online Services, and Nearline Strategy. If the feature of the uploaded data changes, you need to update the file synchronously. The file, in JSON format, contains feature name, feature type, and feature value type.

Table 1 Field description

Parameter

Type

Description

Mandatory

user_features

Array[Object]

User feature. The value is an array with JSON elements. For details, see Table 2.

Yes

item_features

Array[Object]

Item feature. The value is an array with JSON elements. For details, see Table 2.

Yes

Table 2 Example of the global feature information file

Parameter

Type

Description

Mandatory

feature_name

String

Feature name

Yes

feature_type

String

Feature type, including BASIC_INFO, TAGS, and CONTEXT.

NOTE:

CONTEXT is available only in field user_ features.

Yes

feature_value_type

String

Feature value type, including string, numerical, strArray, and map.

NOTE:
  • If feature_type is set to BASIC_INFO or CONTEXT, the options are string, numerical, or strArray.
  • If feature_type is set to TAGS, only map is available.

Yes

Example

{
    "user_features":[
        {
            "feature_name":"provinceId",
            "feature_type":"BASIC_INFO",
            "feature_value_type":"string"
        },
        {
            "feature_name":"salary",
            "feature_type":"BASIC_INFO",
            "feature_value_type":"numerical"
        },
        {
            "feature_name":"hobbies",
            "feature_type":"BASIC_INFO",
            "feature_value_type":"strArray"
        },
        {
            "feature_name":"user_tags",
            "feature_type":"TAGS",
            "feature_value_type":"map"
        },
        {
            "feature_name":"payment_type",
            "feature_type":"CONTEXT",
            "feature_value_type":"string"
        }
    ],
    "item_features":[
        {
            "feature_name":"product_name",
            "feature_type":"BASIC_INFO",
            "feature_value_type":"string"
        },
        {
            "feature_name":"order_price",
            "feature_type":"BASIC_INFO",
            "feature_value_type":"numerical"
        },
        {
            "feature_name":"categories",
            "feature_type":"BASIC_INFO",
            "feature_value_type":"strArray"
        },
        {
            "feature_name":"item_tags",
            "feature_type":"TAGS",
            "feature_value_type":"map"
        }
    ]
}