Task 2: Creating and configuring a predictive model
You upload a PMML file to create a transparent predictive model. Then, you map input and
output data types from the PMML file to data types from the data model.
Step 1: Creating a transparent predictive model
- Open the Customer retention decision service.
- Click Create + in the Models tab.
- Select Predictive model. Enter Transparent churn as the name.
- Make sure the existing Data data model is used as the data source. Then, click Create.
- Click Configure in the right panel.
- Select Local machine learning model as the configuration method and click Next.
- Browse to the churn.pmml file you downloaded in Task 1.
- Keep Business rules selected as the decision logic generation method and click Next.
- Map input data from the PMML file to data types defined in the Data data
model:
Table 1. Data mapping details Data type Source type or value Maps to Statusmarital status the marital status of CustomerRecord S single D divorced M married Gendergender the gender of CustomerRecord F female M male Usagedouble (64 bits) the usage of Subscription EstIncomedouble (64 bits) the estimated income of CustomerRecord Childrendouble (64 bits) the children of CustomerRecord Agedouble (64 bits) the age of CustomerRecord Paymethodpayment method the payment method of Subscription Auto auto CC creditCard CH check CarOwnerboolean Customer Record is car owner Y TRUE N FALSE You cannot map the
RatePlandata type to a corresponding data type from Data. You will define a mapping rule in the next step to do so. - Click Apply.
- Explore the generated predictive model: open the Prediction node and go to the Logic tab to review the rules that were created.
- Go back to the decision diagram.
Step 2: Editing input mapping
- Update the diagram:
- Delete the Input node.
- Connect the CustomerRecord and Subscription nodes to the Input mapping node.
- Delete the connection links between CustomerRecord and Subscription nodes to the Prediction node.
The following screenshot shows what the diagram should look like:

-
- Click the Input mapping node.
- Go to the Logic tab and create a decision table named rate plan mapping.
- Select
the rate plan of 'Subscription'under Subscription in the wizard. - Click Create.
- Whereas
rate planis a double in the PMML churn model, it is an enumeration in the Data data model. Update the decision table to map types:rate plan Input mapping Basic 0 Essentials 1 Gold 2 Premium 3
The ML model input type is automatically generated from the PMML dictionary when
the rules are imported. You can review the DataDictionary of the PMML file to see
how it is defined.
Step 3: Editing output mapping
- Navigate back to the diagram and open the Output mapping node.
- Set its output type to number.
- Go to the Logic tab and create a business rule named mapOutputData.
- Enter the following rule in the
editor:
if the predicted of 'Weight Comparison' is "T" then set decision to the confidence of 'Weight Comparison' ; else set decision to (1 - the confidence of 'Weight Comparison');
Step 4: Running the predictive model
- Go to the Run tab.
- Create a test data set.
- Edit its content as JSON and enter the following
data:
{ "customerRecord": { "age": 35, "carOwner": false, "children": 1, "estimatedIncome": 100000, "gender": "Female", "location": "urban", "maritalStatus": "Single", "name": "Jane" }, "subscription": { "internationalCalls": 0, "localCalls": 0, "longDistanceCalls": 0, "paymentMethod": "Auto", "ratePlan": "Basic", "usage": 50 } } - Click Run.
It returns a number: the probability of a customer to churn.