Icon

01 Credit scoring training workflow - exercise

Training workflow. This workflow accesses the training data from a file, splits and preprocesses it, and trains the credit scoring model.
Step 1. Capture the segments for the prediction workflow

  1. Capture the metanode Data Preprocessing (Apply) and the predictor XGBoost Predictor with the Capture Workflow Start and Capture Workflow End nodes. These nodes don't require configuration but require you to add the correct Table ports.

  2. Define the input explicitly for a better control of the API definition of the prediction workflow*:

    • Add the Container Input (Table) node after the Capture Workflow Start node.

      • Set input table (with the filtered columns) as template, use only 3 rows

      • Omit table spec in API definition


* We need to provide Container Input (Table) node with the template table - how the new data will look during predictions. These data won't have two columns present in the training data: SeriousDlqin2yrs (the target column) and LoanPeriodStart (not available for those who hasn't got a loan yet). Column Splitter node splits those columns and the Column Appender adds them back later for the model evaluation.


Part 1 - Deployment fundamentals

Exercise workflow 01 Credit scoring training workflow

Learning objective: In this exercise you'll learn how to use integrated deployment to capture prediction segments of a training workflow and how to upload, version, and deploy an automatically created prediction workflow on KNIME Business Hub.


Workflow description: Training workflow. This workflow accesses the training data from a file, splits and preprocesses it, and trains the credit scoring model.

  • The preprocessing and predicting parts are captured and saved as an automatically created prediction workflow.

  • Additionally, it uploads the automatically captured and created prediction workflow directly to the KNIME Hub.


You'll find the instructions to the exercises in the yellow annotations.

Step 2. Save the prediction workflow

  1. Connect the Captured Workflow Port Object with the Workflow Writer node

    • Write the workflow to the Prediction workflow folder in Part 1 folder

    • Use custom workflow name: prediction-workflow

    • In the tab Inputs and outputs:

      1. select None for the input node (we added the Container Input (Table) in step 1)

      2. select Container Output (Table) to be added automatically as an output node


Step 5. Upload the prediction workflow directly from the training workflow

  1. Connect to the KNIME Hub using the Space Connector node

    • Select Other space and browse your user space*

  2. Upload the workflow with the Workflow Writer node

    1. Add the File System Connection port and connect to the Space Connector

    2. Select the same output location where you uploaded the prediction workflow manually

    3. Overwrite the prediction workflow that you uploaded manually

    4. Use custom workflow name: prediction-workflow


Step 3. Connect to KNIME Hub and explore

  1. Connect to KNIME Hub from web browser:

  2. Explore the KNIME Hub UI. Explore your user space and your team page if you have a Team subscription or a KNIME Business Hub instance

  3. If you are connecting to KNIME Business Hub, add its mountpoint to KNIME Analytics Platform

    1. Click the button Preferences at the top-right corner

    2. In the new window, in the list on the left side, select KNIME Explorer

    3. In the same window, on the right, click New

    4. In the new window, select KNIME Hub, provide the Hub instance URL, click OK

    5. Click Apply and Close

    6. The Hub mountpoint appeared in the Home page

    7. Click Connect to connect

Step 4. Upload and version the prediction workflow on KNIME Hub

  1. Upload the Prediction workflow folder with the workflow created in step 2 to your user space

    1. Right click on the workflow in the Explorer and select Upload

    2. Select the hub, the course team, and your user space

    3. Make sure to reset the workflow before uploading

  2. Create new version of your workflow on KNIME Hub*

    1. On the workflow page, click Versions

    2. In the new menu, click Create version and provide a name and description

    3. Explore what happens when you select this version


*Note. You can also create a version directly from KNIME Analytics Platform: Open the uploaded workflow from KNIME Analytics Platform and click on the Workflow menu actions → Version history → Create version.

Step 6. Deploy the prediction workflow as a service

  1. On KNIME Hub, explore the workflow you have just uploaded and create a new version

  2. Deploy the prediction workflow as a service. On the workflow page, click Deploy and Create service:

    • Give your deployment a name, select the version you have just created, and the available execution context*

    • In Advanced settings, select the User execution scope, and create the deployment

  3. On the workflow page, find the created deployment, click three dots actions button and click Manage access

    • In the new menu, you can share the deployment with its users. Share it with yourself.


* If there is only one execution context available, it will be selected by default and won't be modifiable

Add target columnfor evaluation
Column Appender
Capture Workflow Start
Data Preprocessing (Apply)
Capture Workflow End
Remove the columns that won'tbe present in the new dataduring the prediction:SeriousDlqin2yrs (target column)LoanPeriodStart (available forexisting customers)
Column Splitter
75% training 25% test
Table Partitioner
Select the periodfrom where to takethe training data
Row Filter
XGBoost Predictor
Data Preprocessing
Container Input (Table)
Historical customer data for existing customers
Table Reader
XGBoost Tree Ensemble Learner
Workflow Writer
Scorer

Nodes

Extensions

Links