All Products
Search
Document Center

Platform For AI:Predict agricultural loan repayment ability

Last Updated:Mar 10, 2026

Build a linear regression model to predict loan repayment ability using historical data on income, land area, and crop types.

Build a linear regression model using historical loan data (annual income, crop types, land area) to predict whether applicants can repay requested loan amounts.

Note

Dataset is fictitious for learning purposes.

Prerequisites

Dataset fields

Field

Type

Description

id

STRING

Unique identifier for each entry.

name

STRING

Applicant name.

region

STRING

Geographic region ordered from north to south.

farmsize

DOUBLE

Farmland area (acres).

rainfall

DOUBLE

Annual rainfall (millimeters).

landquality

DOUBLE

Soil quality score. Higher values indicate better quality.

farmincome

DOUBLE

Annual farming income.

maincrop

STRING

Main crop type cultivated.

claimtype

STRING

Type of loan applied for.

claimvalue

DOUBLE

Requested loan amount.

Build and run workflow

  1. Go to the Machine Learning Designer page.

    1. Log on to the PAI console.

    2. In the left-side navigation pane, click Workspaces. On the Workspaces page, click the name of the workspace that you want to manage.

    3. In the left-side navigation pane, choose Model Training > Visualized Modeling (Designer).

  2. Build workflow.

    1. On the Designer page, click Preset Templates.

    2. In Regression Algorithm Implementation for Agricultural Loan Prediction, click Create.

    3. In Create Workflow, configure parameters or keep defaults.

      Workflow Data Storage specifies OSS bucket path for temporary data and models.

    4. Click OK.

      The workflow is created in about 10 seconds.

    5. In the workflow list, select Regression Algorithm for Agricultural Loan Prediction and click Enter Workflow.

    6. Designer automatically builds the workflow.

      实验

      Area

      Description

      Reads workflow datasets:

      • Training: 100 historical loan records with features like farmsize and rainfall to train the model. claimvalue contains the loan amount recovered.

      • Test: 71 current loan applicants. claimvalue contains the requested loan amount.

      Uses historical data to predict which applicants will receive loan approval.

      Maps string values to numbers. For region, maps north, middle, and south to 0, 1, and 2, then converts to DOUBLE.

      Linear Regression trains and generates a model using historical data. Prediction uses this model to predict loan issuance. Merge Columns combines user ID, predicted value, and requested loan amount.Prediction result prediction_score contains the predicted repayment amount.

      Regression Model Evaluation evaluates model performance. See Evaluation metrics for details.

      Filtering And Mapping identifies eligible applicants whose predicted repayment amount exceeds the requested loan amount.

      Table 1. Evaluation metrics

      Field

      Description

      MAE

      Mean absolute error.

      MAPE

      Mean absolute percentage error.

      MSE

      Mean squared error.

      R

      Multiple correlation coefficient.

      R2

      Determination coefficient.

      RMSE

      Root mean squared error.

      SAE

      Sum of absolute errors.

      SSE

      Sum of squares for error.

      SSR

      Sum of squares due to regression.

      SST

      Total sum of squares.

      count

      Number of rows.

      predictionMean

      Mean of predictions.

      yMean

      Mean of original dependent variables.

  3. Run workflow and view results.

    1. Click image.png above the canvas.

    2. After completion, right-click Filtering and Mapping and choose View Data > Outputs to view eligible applicants.

      输出

Related information

For more information about algorithm components: