All Products
Search
Document Center

Platform For AI:Lorenz curve

Last Updated:Apr 01, 2026

The Lorenz Curve component plots the cumulative distribution of a dataset to reveal inequality. Originally used in economics to visualize income and wealth distribution, it is equally applicable in machine learning for evaluating prediction fairness and detecting bias in resource allocation. The curve plots the cumulative share of a measured value (y-axis) against the cumulative share of the population (x-axis), sorted from lowest to highest.

Configure the component

Method 1: configure in Machine Learning Designer

On the pipeline details page in Machine Learning Designer, add the Lorenz Curve component and configure the following parameters.

Fields Setting tab

ParameterDescription
Select FieldsThe feature column to analyze. Select a numeric column containing values such as income, wealth, or prediction score.

Parameters Setting tab

ParameterDescription
QuantileThe number of equal-probability intervals used to plot the curve. A higher value produces a finer-grained curve.

Tuning tab

ParameterDescription
Computing CoresThe number of cores used for computation. Must be a positive integer.
Memory Size per Core (Unit: MB)The memory allocated to each core, in MB.

Method 2: use PAI commands

Pass parameters directly using Platform for AI (PAI) commands. Use the SQL Script component to run the command. For details, see Scenario 4: Execute PAI commands within the SQL script component.

PAI -name LorenzCurve
    -project algo_public
    -DinputTableName=maple_test_lorenz_basic10_input
    -DcolName=col0
    -DoutputTableName=maple_test_lorenz_basic10_output
    -DcoreNum=20
    -DmemSizePerCore=110;
ParameterRequiredDefaultDescription
inputTableNameYesThe name of the input table.
outputTableNameYesThe name of the output table.
colNameNoThe columns to analyze. Separate multiple column names with commas (,).
NNo100The number of quantile intervals. A higher value produces a finer-grained curve.
inputTablePartitionsNoThe partitions to read from the input table. Supported formats: partition_name=value and name1=value1/name2=value2 (multi-level). Separate multiple partitions with commas (,). Example: name1=value1,value2.
lifecycleNo28The retention period of the output table, in days. Must be an integer.
coreNumNoSystem-determinedThe number of computing cores. Used together with memSizePerCore. Must be a positive integer. The system calculates the instance count based on the volume of input data.
memSizePerCoreNoSystem-determinedThe memory size per core, in MB. Must be a positive integer. Recommended values: (1024, 64 × 1024).

Example

This example uses an 11-row dataset with values 0–10 to show how the component produces a quantile distribution table.

Step 1: Prepare the input data

col0:double
4
7
2
8
6
3
9
5
0
1
10

Step 2: Run the PAI command

PAI -name LorenzCurve
    -project algo_public
    -DinputTableName=maple_test_lorenz_basic10_input
    -DcolName=col0
    -DoutputTableName=maple_test_lorenz_basic10_output
    -DcoreNum=20
    -DmemSizePerCore=110;

Step 3: Review the output

The output table contains two columns: quantile (the population percentile, 0–100) and col0 (the cumulative share of the total value held by that percentile group). A sample of the output:

quantilecol0
00
10.01818181818181818
100.01818181818181818
110.05454545454545454
......
850.8181818181818182
901
1001

Interpreting the output: The col0 value at a given quantile represents the cumulative share of the total held by the bottom X% of the population. For example, at quantile 85, the bottom 85% of values account for approximately 81.8% of the total. At quantile 90, the cumulative share reaches 1 (100%), meaning all values are concentrated within the bottom 90%.