Apart from creating new predictive models or importing PMML models into Pega Platform, you can run your custom artificial intelligence (AI) and
machine learning (ML) models externally in third-party machine learning services. This
way, you can improve your predictive models by using advanced algorithms of machine
learning as a service (MLaaS) providers, such as Google AI Platform, and apply the
results to enhance your customer strategies.
Note: Pega Platform currently supports only Google AI Platform
models.
Before you begin: Define your model and the cloud service connection:
- In a third-party cloud ML service of your choice, create an ML model.
- In Dev Studio, connect to your cloud service instance
by creating an authentication profile. For more information, see Authentication profiles.
For example, for a Google AI Platform service connection, create an
OAuth 2.0 authentication profile.
- In Prediction Studio, define your ML service. For more
information, see Configuring a machine learning service connection.
-
In the navigation panel of Prediction Studio, click Predictions.
-
In the header of the Predictions work
area, click .
-
In the New predictive model dialog box, enter a
Name for your model.
-
In the Create model section, click Select
external model.
-
In the Machine learning service list, select the ML
service from which you want to run the model.
-
In the Model list, select the model that you want to
run.
The list contains all the models that are part of the authentication profile
that is mapped to the selected service.
-
In the Context section, specify where you want to save the
model:
-
Click the Apply to class field, press the Down
arrow key, and click the class in which you want to save the
model.
-
Define the class context by selecting the appropriate values in the
Development branch, Add to
ruleset, and Ruleset version
lists.
-
Verify the settings and click Next.
-
In the Outcome definition section, enter the model
objective.
To enable response capture, the model objective label that you want to monitor
must be the same as the .pyPrediction parameter value in the
response strategy.
-
In the Predicting list, select the model type:
- For binary models, select Two
categories.
- For categorical models, select More than two
categories, and then add the categories that you want to
predict.
- For continuous models, select A continuous value,
and then enter the value range that you want to predict.
-
In the Expected performance field, enter a value that
represents the expected predictive performance of the model:
- For binary models, enter the expected area under the curve (AUC) value
between 50 and 100.
- For categorical models, enter the expected F-score performance value
between 0 and 100.
- For continuous models, enter the expected RMSE value between 0 and
100.
-
Confirm the model settings by clicking Create.
Result: Your custom model is now available in Pega Platform.
-
On the predictive model page, click the Mapping tab, and
then upload a JSON file with input mapping and outcome categories for the
model:
-
Download the baseline JSON file by clicking Download
template.
-
On your local hard drive, define the mapping of input fields to
Pega Platform properties by editing and saving
the template file that you downloaded.
For example: For the Call Context model, use the following input file
structure:
{"predictMethodUsesNameValuePair":false,
"decisionFields":[
{"name":"GENDER","type":"CATEGORICAL"},
{"name":"AGE","type":"NUMERIC"}
],
"modelCreationAutoFillDetails":{
"objective":"Churn",
"outcomeType":"scoring",
"expectedPerformance":"80",
"expectedPerformanceMeasure":"AUC",
"framework":"SCIKIT_LEARN",
"possibleOutcomes":[
"yes",
"no"
]
}
}
-
In Prediction Studio, click Choose
file and double-click your JSON file.
-
Confirm your updates by clicking Save.
What to do next: Add and run your model in a strategy. For more information
about strategies, see "About Strategy rules" in the Dev Studio
help.