Build a scorecard model for credit scoring using PAI Designer financial components and credit card transaction data.
Background
A scorecard is a modeling framework for credit risk assessment and internet finance. Rather than a single algorithm, it applies feature engineering to binned data, then fits a linear model.
Applications include credit card risk assessment, loan disbursement, customer service scoring, and credit scoring systems such as Sesame Credit.
Prerequisites
-
You have created a workspace. For more information, see Create and manage workspaces.
-
You have associated MaxCompute resources with your workspace. For more information, see Create and manage workspaces.
Dataset
This pipeline uses a public dataset (Download dataset) with 30,000 records of user demographics (gender, education, marital status, age), transaction history, and billing statements.
The prediction target is the payment_next_month column, indicating whether a user repaid their credit card bill:
-
1 indicates a repaid bill.
-
0 indicates an outstanding bill.
Build and run the scorecard pipeline
Go to the Machine Learning Designer page.
Log on to the PAI console.
In the left-side navigation pane, click Workspaces. On the Workspaces page, click the name of the workspace that you want to manage.
In the left-side navigation pane, choose .
-
Build the pipeline.
-
On the Designer page, click the Preset Templates tab.
-
On the Preset Templates page, click Create under Credit Consumption Analysis Based on Scorecard.
-
In the Create Pipeline dialog box, configure the parameters. You can use the default settings for all parameters.
The Data Storage parameter specifies an OSS Bucket path to store temporary data and models generated during the pipeline run.
-
Click Confirm.
It takes about 10 seconds to create the pipeline.
-
On the Pipelines tab, double-click Credit Consumption Analysis Based on Scorecard to open the pipeline.
-
The system builds the pipeline from the preset template.

Area
Description
①
Splits the dataset into training and prediction sets.
②
The Binning component maps data to high-dimensional features by distribution interval, similar to one-hot encoding. After the pipeline completes, right-click Binning-1 and select Binning. In the configuration panel, click a feature name (for example, age) to view bin details.
The binning details table shows 10 bins for a feature (from (-inf,25] to (49,+inf)), with the following information for each bin:
Label: Bin interval range
Constrain: Constraint conditions (Operator and Value), not set by default
WOE: WOE values for each bin (e.g., 0.250, -0.091, -0.114)
Number: Total, Positive, and Negative sample counts (e.g., row 0: Total=3138, Positive=845, Negative=2293)
To view binning intervals per field, right-click Binning-1 and choose .
The feature binning summary table shows binning results for all 21 features (sex, education, marriage, limit_bal, age, pay_0–pay_6, bill_amt1–bill_amt6, pay_amt1–pay_amt6), with each feature represented by a JSON segment containing the following key fields:
iv: Information Value (e.g., sex = 0.003556, limit_bal = 0.075548, pay_0 = 0.046904)
n: Sample count
p: Positive sample count
prate: Positive sample rate
total: Total sample count
③
Compares sample stability before and after split/binning, returning the Population Stability Index (PSI) per feature. After the pipeline runs, right-click PSI-1 and choose to view details.

PSI quantifies distribution shift. Per-feature PSI is the sum across all bins: below 0.1 = insignificant change, 0.1–0.25 = moderate change, above 0.25 = significant change requiring review.
④
Scorecard training. After the pipeline runs, right-click Scorecard Training-1 and choose to view results.
The scorecard model output result table shows binning statistics for three features: intercept, pay_0 (bins include (-inf,-1], (-1,0], (0,1], (1,2], (2,+inf) totaling 8 rows), and limit_bal (bins from (-inf,30000] to (360000,+inf) totaling 11 rows). Columns include weight, scaled_weight, and contribution, as well as feaname, binid, bin, constraint, woe, total, positi, negativ, percentage_pos, percentage_neg, in_mode, test_woe, and test_contribution.
A scorecard converts model weights into business-friendly scores. Key parameters:
-
weight: Original weight value.
-
Scaled_weight: Score change per bin. For example, for pay_0: values in (-1,0] reduce the score by 29; values in (0,1] increase it by 27.
-
contribution: Feature impact on the result. Larger values indicate greater impact.
⑤
Predicts credit scores and evaluates model performance.
-
-
Run the pipeline and view the results.
-
Click the run icon
at the top of the canvas. -
After the pipeline finishes, right-click Scorecard Prediction-1 and choose to view credit scores.
The output results contain the following fields:
payment_next_month: Next month payment behavior label (0 or 1)
prediction_score: Credit score (e.g., 685, 525)
prediction_prob: Prediction probability
prediction_detail: Detailed probability for each class (JSON format, containing probabilities for class 0 and class 1)
-
Related topics
Component references: