You need to enable JavaScript to run this app.
Intelligent Data Insight

Intelligent Data Insight

Copy page
Download PDF
Data Operation
Feature Engineering
Copy page
Download PDF
Feature Engineering

This document introduces the usage of feature engineering module operators, including binarization, principal component analysis, Cartesian product, discrete cosine transform, row normalization, column normalization, singular value decomposition, feature hashing, one-hot encoding, Array processing, Map processing, feature importance, feature selection, and many others.

Function overview

Feature engineering generally refers to the process of transforming raw data into features that better represent the essence of the problem, so that using these features in predictive models can improve the model's prediction accuracy on unseen data. After completing data input, feature engineering operators can be used to further process the input data. The following sections provide a detailed introduction to these operators.

Feature engineering operators

Introduction

Binarization

Convert numerical features into binary features 0 or 1 to categorize quantitative features as "yes" or "no" and remove redundant information

Principal component analysis

Reduce data dimensionality by mapping high-dimensional features to a low-dimensional orthogonal space, retaining most of the original information

Cartesian product

Calculate the Cartesian product of two sets of numerical features to generate combinations between features

Discrete cosine transform

A digital signal processing technique that converts time-domain signals into frequency-domain representations, mainly used for data compression and feature extraction

Row normalization

Normalize each row of data so that all rows are on the same scale

Column normalization

Standardize, apply min-max scaling, or apply max-abs scaling to the specified columns to make data with different scales or units comparable

Singular value decomposition

Simplify numerical data by selecting the largest singular values to project the data into a low-dimensional space

Feature hashing

Map high-dimensional features to a fixed-dimensional vector space using a hash function, suitable for feature compression of large-scale sparse data

One-hot encoding

Convert discrete categorical variables into N binary features (0/1), with each new feature corresponding to a possible value of the original feature

Array processing

Perform batch operations on array-type fields, supporting automatic detection of array formats and optimization of storage structure

Map processing

Operate on columns containing key-value pair structures, mainly used for parsing and processing mapping-type data such as JSON and dictionaries

Feature importance

Calculate the weight of each feature for the target variable to help identify the most influential features, supporting seven computation methods

Feature selection

Select key features based on feature importance weights, supports three selection methods: by threshold, by Top K, and by Top percentage

Function description

Binarization

Binarization converts numerical features into binary features, 0 or 1. In the field of data mining, the purpose of binarization is to divide quantitative features into "yes or no" categories to eliminate redundant information.
Usage example:
Example 1: Customer value segmentation

  • Operation field: "Annual spending amount"
  • Parameter settings:
    • Selection type: single
    • Binary classification threshold: 10 000
    • Replace original column: Yes
    • Output column name: High-value customer flag
  • Output result:
    • Original value ≥ 10000 → Converted to 1
    • Original value < 10000 → Converted to 0

Example 2: Financial risk assessment

  • Operation field: "Debt-to-asset ratio"
  • Parameter settings:
    • Selection type: single
    • Binary classification threshold: 0.7
    • Replace original column: No
    • Output column suffix: _risk flag
  • Output result:
    • Add new column "Debt-to-asset ratio_risk flag"
    • Original value ≥ 0.7 → New column value is 1
    • Original value < 0.7 → New column value is 0

Parameter description:

Parameters

Description

Selection type

Select field range:
• all: All numerical columns
• single: Only a single column. You must also select a single column name.
• subset: Customize multiple columns. At least one column must be selected.

Invert selection

Disabled by default. If enabled, the logic is reversed (the original rule ≥ threshold → 1 becomes < threshold → 1).

Replace original column

Enabled by default. When enabled, the original field is replaced directly; otherwise, a new column is added.

Output column suffix

Suffix for the new column (applies when "Replace original column" is disabled).

Binary classification threshold

The default value is 0.5. The cutoff for numeric values: values greater than or equal to the threshold are converted to 1; otherwise, they are converted to 0.

Principal component analysis

Principal component analysis (PCA) is a dimensionality reduction algorithm that maps high-dimensional features to a low-dimensional orthogonal space (principal components), reducing the number of features while retaining most of the original information. This function only supports operations on attributes that are numeric and have the role "regular". The output results are usually used as input for other analytical models.

tip

regular: Refers to basic data attributes used as standard input features for model training or analysis. These attributes are the core basis for model computation and learning, and do not serve special functions (such as serving as a sample ID or being used only as filtering criteria for data selection).

Usage example:
Example 1: Dimensionality reduction for customer credit scoring

  • Business scenario: A bank needs to perform dimensionality reduction on 15 customer financial indicators
  • Parameter settings:
    • Feature columns: Select all 15 financial indicators (such as "annual income", "debt ratio", "credit card limit", and more)
    • Dimensionality reduction method: Select "keepVariance"
    • Percentage: Set to 0.90 (retain 90% of the original information) (after execution, the system automatically determines to retain 5 principal components)
  • Result application: Use the 5 output principal components as inputs for the credit scoring model

Example 2: Visualization of product sales data

  • Business scenario: An e-commerce platform wants to visualize 20 product features after dimensionality reduction
  • Parameter settings:
    • Feature columns: Select 20 sales-related features (such as "monthly sales volume", "number of favorites", "click-through rate", and more)
    • Dimensionality reduction method: Select "fixedNumber"
    • k value: Set to 3 (for three-dimensional visualization)
  • Result application: Use the 3 principal components to perform three-dimensional scatter plot analysis of product clustering

Parameter description:

Parameter

Description

Feature columns

Numeric feature columns participating in PCA analysis; multiple columns can be selected.

Dimensionality reduction method

Determine the dimensionality reduction method and the degree of reduction.

  • none: No dimensionality reduction; output all principal components. That is, if the input data contains n attributes, the output principal component vector will be n-dimensional.
  • fixedNumber: Specify the number of principal components to retain. The k value must also be set; the default value for k is 1.
  • keepVariance: Retain principal components according to the cumulative variance ratio. The percentage parameter value must also be provided; the default is 0.99, indicating that the retained principal components after dimensionality reduction must explain at least 99% of the information in the original data.

Cartesian product

The Cartesian product refers to the Cartesian product of two sets X and Y, also known as the direct product, denoted as X × Y. Each ordered pair consists of a member from X and a member from Y.
Usage example:
Example 1: Generating product specification combinations

  • Original data table (products)

    product_id

    length

    width

    height

    1001

    30

    20

    10

    1002

    40

    25

    15

  • Parameter settings:

    • Left operand column: length
    • Right operand column: width
  • Output result:

    product_id

    length

    width

    height

    interaction result

    1001

    30

    20

    10

    600

    1002

    40

    25

    15

    1000

Parameter description:

Parameter

Description

Selected columns for left operand

The first dimension columns of the Cartesian product; must be numeric and multiple columns can be selected.

Selected columns for right operand

The second dimension columns of the Cartesian product; must be numeric and multiple columns can be selected.

warning

There must be no duplicate fields between "Selected columns for left operand" and "Selected columns for right operand".

Discrete cosine transform

The discrete cosine transform (DCT) is a digital signal processing technique that converts time-domain signals into frequency-domain representations. This function uses a mathematical transformation to convert a real-valued sequence of length N into a frequency-domain coefficient sequence of the same length, mainly used for data compression and feature extraction.

tip

Core concept explanation:

  • Time domain and frequency domain: The time domain is the original waveform of the signal as it varies over time (such as an ECG curve); the frequency domain is the distribution of frequency components after the signal is decomposed (such as an audio spectrogram).
  • Forward DCT and inverse DCT: The forward transform converts the original signal into frequency domain coefficients for feature extraction (such as image compression); the inverse transform restores the frequency domain coefficients to time domain signals for data reconstruction (such as file decompression).

Usage example:
Example 1: Audio signal feature extraction

  • Business scenario: Extracting frequency-domain features from audio waveform signals for speech recognition or compression.

  • Parameter settings:

    • Feature column: audio_waveform (audio sample point sequence)
    • Inverse: false (forward DCT, time domain → frequency domain)
    • Output column: feature_transformed (frequency-domain coefficients are automatically generated)
  • Output effect:

    audio_waveform (original signal)

    feature_transformed (DCT coefficients)

    0.1

    12.8

    0.5

    5.3

    -0.2

    -1.2

    ...

    ...

Parameter description:

Parameter

Description

Feature columns

Features used for training; multiple selections are allowed.

Inverse

Used to control the transformation direction:
• Off: Forward DCT (time domain → frequency domain)
• On: Inverse DCT (frequency domain → time domain)

Row normalization

Row normalization is a data standardization method that normalizes each row of data, ensuring that all rows are comparable on the same scale, which facilitates subsequent comprehensive analysis and modeling.
Usage example:
Example 1: Normalizing user behavior data

  • Original data:

    User ID

    Click count

    Browsing duration (seconds)

    Purchase amount (CNY)

    1001

    20

    300

    500

    1002

    50

    600

    200

  • Parameter settings:

    • Feature columns: ["Number of clicks", "Browsing duration", "Purchase amount"]
    • p-value: 2 (Euclidean normalization)
  • Result after processing:

    User ID

    feature_transformed (array format)

    1001

    [0.036, 0.539, 0.842]

    1002

    [0.078, 0.937, 0.312]

Parameter description:

Parameter

Description

Feature columns

Features used for training; here refers to the numeric fields that need to be normalized. Multiple selections are allowed.

p

  • The exponent parameter for normalization, a real number greater than 0, representing the norm value.
  • After normalization, the sum of the p-th powers of each attribute in each row equals 1.
  • Common values:
    • 1 (Manhattan normalization)
    • 2 (Euclidean normalization)

Column normalization

Column normalization is a data preprocessing method that scales specified columns to make data with different units comparable. It supports three scaling methods: standardization (standard), min-max scaling (min-max), and max-abs scaling (max-abs). In-place modification is not supported for now. The generated result is a single array column. To split it into separate columns, add a vector decomposer operator after this operator.

tip

inplace modification: Refers to modifying the original data object directly without creating a new copy. Simply put, when performing an operation on data (such as modifying values, deleting elements, converting formats, and so on), if using the inplace method, the operation is applied directly to the original data. After the operation, the original data becomes the modified version, and no additional data object is created to store the result.

Usage example:
Example 1: Standardization (standard) scaling

  • Calculation formula: (x - mean of 5000) / standard deviation of 2449.49

    User ID

    Original sales amount

    Standardization result (std_scale)

    1001

    2000

    -1.2247

    1002

    5000

    0

    1003

    8000

    1.2247

Example 2: Min-max scaling

  • Calculation formula: (x - min of 18) / (max of 52 - min of 18)

    User ID

    Original age

    Min-max result (std_scale)

    1001

    18

    0.0

    1002

    35

    0.5

    1003

    52

    1.0

Example 3: Max-abs scaling example

  • Calculation formula: x / max(abs(800), abs(-400))

    User ID

    Original profit

    Max-abs result (std_scale)

    1001

    -400

    -0.5

    1002

    200

    0.25

    1003

    800

    1.0

Parameter description:

Parameter

Description

Feature columns

Features used for training; here refers to the numeric columns that need to be normalized. Multiple selections are allowed.

Scaling type

Select the column normalization method.

  • standard: Standardization, formula is (x - μ)/σ, mean is 0, standard deviation is 1, and the data distribution is approximately normal.
  • min-max: Min-max scaling, formula is (x - min)/(max - min), value range [0, 1], for data with clear boundaries.
  • max-abs: Max-abs scaling, formula is x/max(abs(x)), value range [-1, 1], for data containing both positive and negative values.

Use standard deviation

Enabled by default. For the standard method only; whether to use the standard deviation.

Use mean

Enabled by default. For the standard method only; whether to use the mean.

Minimum value

The default is 0. For the min-max method only; specifies the minimum value.

Maximum value

The default is 1. For the min-max method only; specifies the maximum value.

Singular value decomposition

Singular value decomposition (SVD) is a dimensionality reduction method that simplifies numerical data by projecting it into a lower-dimensional space using higher singular values. This feature only supports operations on numerical attributes with the role "regular". The output result usually needs to be used as input for other analytical models.

tip

regular: Refers to basic data attributes that are used as regular input features for model training or analysis. These attributes are the core basis for model computation and learning, and do not serve special functions (such as identifying the sample ID or acting as filter criteria used only for data selection).

Usage example:
Example 1: Dimensionality reduction for financial risk control features

  • Business scenario: A bank needs to reduce the dimensionality of 30 highly correlated financial indicators for use in a credit risk assessment model
  • Parameter settings:
    • Feature columns: Select 30 financial indicators (including "debt-to-asset ratio", "current ratio", "profit margin", and more)
    • Dimensionality reduction method: Select "keepVariance"
    • Percentage: Set to 0.85 (retain 85% of the original information) (After execution, the system automatically determines to retain 8 principal components)
  • Execution result: The system automatically retains 8 principal components
  • Result application: Use the 8 SVD features as input for the risk control model

Example 2: Retail user profile construction

  • Business scenario: The e-commerce platform needs to reduce the dimensionality of 100-dimensional user behavior data
  • Parameter settings:
    • Feature columns: Select 100 behavioral features ("click-through rate", "dwell time", "add-to-cart frequency", and more)
    • Dimensionality reduction method: Select "fixedNumber"
    • k value: Set to 10
  • Execution result: Generate 10 core features
  • Result application: Used for the user segmentation system to improve clustering speed

Parameter description:

Parameter

Description

Feature column

Features used for training; here, this refers to the numerical features involved in decomposition. You can select multiple options.

Dimensionality reduction method

Determines the dimensionality reduction method and the degree of reduction.

  • none: No dimensionality reduction; outputs all principal components. If the input data contains n attributes, the output principal component vector will be n-dimensional.
  • fixedNumber: Specifies the number of principal components to retain. You also need to set the k value. The default value of k is 1.
  • keepVariance: Retains principal components according to the cumulative variance ratio. You also need to provide the percentage parameter. The default percentage is 0.99, which means the retained principal components after dimensionality reduction must explain at least 99% of the information in the original data.

Feature hashing

Feature hashing (Hashing Trick) is a fast dimensionality reduction technique that maps high-dimensional features (such as text word frequencies and categorical variables) into a fixed-dimensional vector space using a hash function. It is suitable for feature compression of large-scale sparse data and avoids the dimensionality explosion problem of traditional one-hot encoding.
Usage examples:
Example 1: Text word frequency dimensionality reduction

  • Business scenario: Compress 10,000-dimensional text word frequency features to 512 dimensions
  • Parameter settings:
    • Selection type: single
    • Select column: word_counts (a dictionary column storing word frequencies, such as {"apple":3, "banana":1})
    • Number of features: 512
    • Reverse selection: false
  • Execution result:
    • Original data: {"apple":3, "banana":1, ...} (more than 10,000 words)
    • Output result: [0.0, 1.2, 0.0, ..., -0.8] (512-dimensional vector)

Example 2: User behavior feature compression

  • Business scenario: Compress 5,000-dimensional user behavior ID features to 256 dimensions
  • Parameter settings:
    • Selection type: subset
    • Select columns: ["click_ids", "view_ids"]
    • Number of features: 256
    • Reverse selection: false
  • Execution result:
    • Original data: click_ids=[123,456,...], view_ids=[789,...]
    • Output result: [0.5, 0.0, -1.3, ..., 0.7] (256-dimensional vector)

Parameter description:

Parameter

Description

Selection type

Select field range:
• all: All numeric columns
• single: Only a single column. You also need to select a single column name.
• subset: Custom multiple columns. You also need to select at least one column.

Inverse selection

If enabled, the unselected columns will be retained.

Number of features

The feature dimension after dimensionality reduction. The default is 1024. It is recommended to set it as a power of 2 (such as 256 or 512).

One-hot encoding

One-hot encoding is a method for converting discrete categorical variables into a form that is easier for machine learning algorithms to understand. It expands a feature with N different values into N binary features (0/1), with each new feature corresponding to one possible value of the original feature.
Usage example:
Example 1: Color feature encoding

  • Original data:

    product_id

    color

    1001

    red

    1002

    blue

    1003

    green

  • Parameter settings:

    • Column: ["color"]
  • Processed result:

    product_id

    color

    1001

    [1, 0, 0]

    1002

    [0, 1, 0]

    1003

    [0, 0, 1]

Example 2: Simultaneous encoding of multiple columns

  • Original data:

    user_id

    gender

    age_group

    2001

    male

    young

    2002

    female

    middle

    2003

    male

    old

  • Parameter settings:

    • Columns: ["gender", "age_group"]
  • Processed result:

    user_id

    gender

    age_group

    2001

    [1, 0]

    [1, 0, 0]

    2002

    [0, 1]

    [0, 1, 0]

    2003

    [1, 0]

    [0, 0, 1]

Parameter description:

Parameter

Description

Column

Features used for training; here, this refers to the text fields that require one-hot encoding. You can select multiple options.

Array processing

Array processing is an operator for batch operations on array-type fields (such as [1.2, 0.5, -0.3]), with the core function of converting array types into one-hot encoding types.
Usage example:
Example 1: Convert array to one-hot encoding

  • Original data:

    ID

    raw_vector

    1

    [1, 2, 3]

    2

    [2, 3]

    3

    [3]

  • Parameter settings:

    • Column: ["raw_vector"]
    • Number of sampled data rows: 200000 (used to analyze all possible values in the array)
  • After processing:

    ID

    features

    1

    [1, 1, 1]

    2

    [0, 1, 1]

    3

    [0, 0, 1]

Parameter description:

Parameter

Description

Column

Select the column containing arrays.

Number of sampled data rows

The sample size used to analyze all possible values in the array. The default is 200,000.

Map processing

Map processing is an operator used with machine learning algorithms, operating on feature fields of type map<string, double>. The core function is to convert map<string, double> type to an array type with one-hot encoding. The system first samples the specified number of rows to analyze all possible keys, then processes the entire dataset uniformly.
Usage example:
Example 1: Convert map data to one-hot encoding

  • Original data table

    order_id

    order_detail (map<string, double> type)

    10001

    {"price":299.0, "items":2.0}

    10002

    {"price":599.0, "discount":0.8}

  • Parameter settings:

    • Column: ["order_detail"]
    • Number of sampled data rows: 200000 (used to analyze all possible keys)
  • Processed result table:

    order_id

    features

    10001

    [1, 1, 0]

    10002

    [1, 0, 1]

Parameter description:

Parameter

Description

Column

Select the column containing map<string, double> type.

Number of sampled data rows

The sample size used to analyze all possible keys in the map. The default is 200,000.

Feature importance

Feature importance is used to calculate the weight of each feature in the dataset, helping to identify the features that have the greatest impact on the target variable. Multiple calculation methods are supported and are applicable to vector or single-column features. For vector columns, the output format is original_column_name__index (index starts from 0).
Usage example:
Example 1: House price prediction

  • Original data table (house_data)

    house_id

    area

    rooms

    location_score

    price_label

    1001

    85

    3

    [0.7,0.2]

    1

    1002

    60

    2

    [0.5,0.3]

    0

    1003

    120

    4

    [0.9,0.1]

    1

  • Parameter settings

    • Feature columns: ["area", "rooms", "location_score"]
    • Label column: price_label
    • Calculation method: gini (Gini coefficient)
  • Processed result table

    column

    weight

    area

    0.78

    rooms

    0.65

    location_score__0

    0.42

    location_score__1

    0.15

Example 2: Credit card default analysis

  • Original data table (credit_data)

    user_id

    income

    debt_ratio

    payment_history

    default_flag

    2001

    50000

    0.35

    [1,1,0,1]

    0

    2002

    32000

    0.72

    [0,1,0,0]

    1

  • Parameter settings

    • Feature columns: ["income", "debt_ratio", "payment_history"]
    • Label column: default_flag
    • Calculation method: info_gain_ratio (information gain ratio)
  • Processed result table

    column

    weight

    debt_ratio

    0.91

    payment_history__0

    0.47

    payment_history__1

    0.32

    income

    0.28

Parameter description:

Parameter

Description

Feature column

Features used for training; here, this refers to the features for which weights need to be calculated. You can select multiple options.

Label column

The basis for classification training; only a single option can be selected.

Feature importance calculation method

  • chisq: Chi-square test, suitable for classification problems, tests the independence between categorical features and categorical labels (such as the relationship between gender and purchase intention).
  • corr: Correlation coefficient, suitable for regression problems, measures the linear correlation between numerical features and numerical labels (such as the relationship between house price and area).
  • gini: Gini coefficient, suitable for classification problems, measures the contribution of a feature to class purity (such as feature splits in decision trees).
  • info: Information gain, suitable for classification problems, measures a feature's ability to reduce label uncertainty (such as keyword selection in text classification).
  • info_gain_ratio: Information gain ratio, an improved version of information gain, addresses the preference for multi-valued features (such as ID-type features).
  • pca: Principal component analysis, suitable for dimensionality reduction or unsupervised learning, measures feature importance through explained variance (such as image compression).
  • fvalue: F-test value, suitable for regression or classification problems, tests the significance of the linear relationship between features and labels (such as screening medical indicators).

Feature selection

Feature selection calculates the importance weight of each feature with respect to the target variable, helping users identify key features and remove redundant ones. Supports numerical and vector features, and automatically expands vector columns (format: original_column_name__index). Applicable to preliminary feature selection for classification and regression tasks.
Usage example:
Example 1: Financial risk control feature selection

  • Original data table (loan_risk)

    user_id

    income

    debt_ratio

    behavior_scores

    is_default

    1001

    50000

    0.3

    [0.8, 0.2, 0.5]

    0

    1002

    32000

    0.6

    [0.6, 0.3, 0.1]

    1

  • Parameter settings

    • Feature columns: ["income", "debt_ratio", "behavior_scores"]
    • Label column: is_default
    • Calculation method: info_gain_ratio (information gain ratio)
    • Selection threshold: 0.3 (retain features with importance ≥ 0.3)
  • Processed result

    Feature name

    Importance score

    Keep

    debt_ratio

    0.85

    ✓

    behavior_scores__0

    0.42

    ✓

    income

    0.25

    ✗

    behavior_scores__1

    0.18

    ✗

    behavior_scores__2

    0.10

    ✗

    Final retained features: debt_ratio, behavior_scores__0

Example 2: E-commerce recommendation feature selection

  • Original data table (user_behavior)

    user_id

    click_count

    purchase_history

    user_group

    2001

    20

    [1, 0, 1, 1, 0]

    A

    2002

    5

    [0, 1, 0, 0, 1]

    B

  • Parameter settings

    • Feature columns: ["click_count", "purchase_history"]
    • Label column: user_group
    • Computation method: gini (Gini coefficient)
    • Selection threshold: 0.4
  • Result after processing

    Feature name

    Importance score

    Keep

    purchase_history__0

    0.62

    ✓

    purchase_history__3

    0.55

    ✓

    click_count

    0.38

    ✗

    purchase_history__1

    0.22

    ✗

    Final retained features: purchase_history__0, purchase_history__3

Parameter description:

Parameter

Description

Feature columns

Features used for training. Here, it refers to the features for which weights need to be calculated. Multiple selections are supported.

Label column

The basis for classification training. Only one can be selected.

Feature importance calculation method

  • Chi-square test (chisq): Suitable for classification problems, tests the independence between categorical features and labels (such as gender and purchase intention).
  • Correlation coefficient (corr): Suitable for regression problems, measures the linear correlation between numerical features and labels (such as income and consumption level).
  • Gini coefficient (gini): Suitable for classification problems, evaluates the contribution of features to class purity (such as feature splits in decision trees).
  • Information gain (info): Suitable for classification problems, measures a feature's ability to reduce label uncertainty (such as keyword selection).
  • Information gain ratio (info_gain_ratio): An improved version of information gain, addresses the preference for multi-valued features (such as user ID-type features).
  • Principal component analysis (PCA): Suitable for unsupervised dimensionality reduction, evaluates feature importance based on explained variance (such as image feature compression).

Weight-based selection

  • Threshold (filtering by threshold): Retain features with importance scores greater than or equal to the set threshold (for example, >0.3).
  • Top K (top K features): Retain the top K features ranked by importance (for example, Top 5).
  • Top p% (top percentage): Retain the top p% of features ranked by importance (for example, Top 20%).
Last updated: 2026.06.11 17:42:16