Feature Engineering

A feature engineering job processes offline data in RES.

  1. It extracts user and item profile data and general data from the offline data sources.
  2. It also processes general data into training or test data required by training ranking models.

Two types of feature engineering jobs are as follows:

Figure 1 Feature engineering

Creating a Feature Engineering Job

To create a feature engineering job, perform the following steps:

  1. Choose Offline Jobs > Feature Engineering > Create to display a page where you can create the feature engineering jobs.
  2. On the Create Feature Engineering Job page, specify Name, Scenario, and Description.
    • Name: Name of the feature engineering job to be created, which must start with ETL- and consists of only letters, digits, hyphens (-), and underscores (_). The name must contain no more than 64 characters.
    • Scenario: You can select a scenario created on the Global Configurations page.
  3. In the Compute Engine area, enter values for Service Name, Cluster Name, Configuration File Path, and Name.
  4. Click Add Feature Engineering and select a proper strategy from the drop-down list box based on business requirements. Move your cursor to the question marks next to Initial User Profile-Item Profile-Standard Wide Table Generation and Ranking Training Sample Preprocessing to view the help information.
  5. (Optional) Select a strategy you want to delete and click Delete to delete it.
  6. After entering all parameter values, click OK. Generally, it may take several minutes or tens of minutes to run the job. The duration depends on the amount of your selected data and resources.

    You can switch to the feature engineering job list to view the basic information about feature engineering jobs. In the featuring engineering job list, the status of the newly created job is Computing. When it changes to Successful, the job execution is complete and the processed data will be used by the offline jobs. If the status of a feature engineering job changes to Failed, click the job name. On the job details page that is displayed, view the job logs and troubleshoot the faults.

Initial User Profile-Item Profile-Standard Wide Table Generation

The Initial User Profile-Item Profile-Standard Wide Table Generation strategy processes the standard data into data with a format required by user and item profiles, or the general (JSON) data.

Table 1 Parameters

Parameter

Description

Storage Type

Storage type, which is classified into User Profile Table and Item Profile Table.

  • User Profile Table: Custom CloudTable cluster and table, storing user data.
  • Item Profile Table: Custom CloudTable cluster and table, storing item data.

Result Save Path

Path where behaviors, user data, and item data reside

NOTE:

Data generated by the Initial User Profile-Item Profile-Standard Wide Table Generation strategy can be stored in specific folders.

Retain Wide Table

Mode of retaining the existing wide table data in the result saving path.

  • No: No existing data is retained.
  • Yes: All existing data is retained.
  • Overwrite: Data of the same date is overwritten and data of different dates is retained.

Global Feature File

File needed before you create feature engineering jobs. The global feature file is also needed in Online Services.

For details, see Global Feature Files.

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.

Data Source

OBS path where User Attribute Table, Item Attribute List, and User Operation Behavior Table reside.

Ranking Training Sample Preprocessing

The Ranking Training Sample Preprocessing strategy can process the standard data into data of a required format and simultaneously perform data discretization and data encoding.

Table 2 Parameters

Parameter

Description

Result Save Path

Root path for saving all output data. Five folders (feature_map, features_info_online_use, fields_feature_size, test_data, and train_data) are automatically created in the root directory to store the corresponding file with the same name.

Global Feature File

File needed before you create feature engineering jobs. The global feature file is also needed in Ranking Strategy and Online Services.

For details, see Global Feature Files.

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.

Root Path for Storing JSON Data Source

Root directory where the JSON data resides, which is the same as the Result Save Path for storing data generated when submitting the Initial User Profile–Item Profile-Standard Wide Table Generation job, or the Result Save Path for storing data generated when adding the Update User Profile Based on Behavior Data strategy.

Time Range

Time range for collecting user behavior data. You can specify the start and/or end time, or leave it blank.

To-Be-Extracted User Feature

Input user feature extracted from the global feature files for training ranking models

NOTE:

The number of discrete ranges cannot exceed 100. Set this parameter as required.

Click to add user features. If Feature Value Type is set to Single-value number, the optional parameters are as follows:

  • Equidistant discrete: Enter the values for Min., Max., and Distance as needed. For example, if you want to perform equidistant discrete on age, set the Min. to 1, the Max. to 100, and the Distance to 10. Then, the 10-year-old is a discrete distance.
  • Equal-frequency discrete: Enter the values for Min., Max., and Frequency as needed. For example, if you want to perform equal-frequency discrete on weight, set the Min. to 5, the Max. to 200, and the Frequency to 200. Then, the discrete weights are ranked according to their weight values and 200 is their discrete frequency.
  • User-defined discrete: Enter the values for Min., Max., and Period Name as needed. For example, if you want to perform discrete operations on "age", set the Min. to 1, the Max. to 3, and the Period Name to Kids. If you click , you can add another period. Then you can define parameters as you like, for example, 4 for Min., 12 for Max., and Children for Period Name.
  • No discrete: (Default) No normalization or data processing is performed. Normalization means to specify the values for Min. and Max. based on business requirements. For example, to normalize the values of "weight", set Min. to 50 and Max. to 200. If the specified value x is within this range, the following formula is used: x_new = (x - 50) / (200-50). If the value x is not within this range, it will be considered as an abnormal value. For example, if value x equals 80, x_new = 0.2.

To-Be-Extracted Item Feature

Input item feature extracted from the global feature files for training ranking models

NOTE:

The number of discrete ranges cannot exceed 100. Set the parameter properly based on business requirements.

Click to add item attributes. If Feature Value Type is set to Single-value number, the optional parameters are as follows:

  • Equidistant discrete: Enter the values for Min., Max., and Distance as needed. For example, if you want to perform equidistant discrete on order price, set the Min. to 1, the Max. to 100, and the Distance to 10. Then, the interval CNY 10 is a discrete distance.
  • Equal-frequency discrete: Enter the values for Min., Max., and Frequency as needed. For example, if you want to perform equal-frequency discrete on weight, set the Min. to 5, the Max. to 200, and the Frequency to 200. Then, the discrete weights are ranked according to their weight values and 200 is their discrete frequency.
  • User-defined discrete: Enter the values for Min., Max., and Period Name as needed. For example, if you want to perform user-defined discrete on order price, you can set the Min. to 1, the Max. to 156, and the Period Name to Low price zone. If you click , you can add another period. Then you can define parameters as you like, for example, 157 for Min., 500 for Max., and Medium- and high-price zone for Period Name.
  • No discrete: (Default) No normalization or data processing is performed. Normalization means to specify the values for Min. and Max. based on business requirements. For example, to normalize the values of "weight", set Min. to 50 and Max. to 200. If the specified value x is within this range, the following formula is used: x_new = (x - 50) / (200-50). If the value x is not within this range, it will be considered as an abnormal value. For example, if value x equals 80, x_new = 0.2.

Positive Feedback Behavior

Custom. Behaviors are the same as the values of parameter actiontype in field behavior from the JSON data source.

Negative Feedback Behavior

Custom. Behaviors are the same as the values of parameter actiontype in field behavior from the JSON data source.

Operator Type

Type of the operator that processes ranking data. Each ranking algorithm requires special data processing. Therefore, the operator type is selected according to the used ranking algorithms. LR, FM, FFM and DeepFM can process the same types of data.

Division of Training and Test Sets

Method to divide training sets and test sets. The options are Time and Rate.

TIME
  • Time Range of Training Data Collection: Start time and end time for training data collection, which cannot be greater than the latest time when a behavior occurs.
  • Time Range of Test Data Collection: Start time and end time for test data collection, which cannot be greater than the latest time when a behavior occurs.
RATE
  • Training Data Rate: Proportion of the training set to the entire set (comprising training set and test set) in the generated results. The default value is 0.7.
  • Test Data Rate: Proportion of the test set to the entire set (comprising training set and test set) in the generated results. The default value is 0.3.