12 Using Machine Learning Models for Scoring and Prediction

The predictive model is an algorithm that you apply to streaming data to predict outcomes. In GoldenGate Stream Analytics, a predictive model is a PMML file, that you upload and store in the system. GGSA supports PMML versions 3.0, 3.1, 3.2, 4.0, and 4.1. In a pipeline, you use a predictive model in a scoring stage to do probability scoring.

12.1 Importing a Predictive Model

To import a predictive model:
  1. On the Catalog page, click Create New Item, and select Predictive Model from the drop-down list.
  2. On the Type Properties screen, enter the following details:
    • Name
    • Description
    • Tags
    • Connection Type: Select Kafka, from the drop-down list.
  1. Under Type Properties do the following and then click Next:
  2. Under Predictive Model Details, do the following and click Save:
    1. For Predictive Model URL, upload your PMML file.
    2. In the Model Version field, enter the version of this artifact. For example, 1.0.
    3. (Optional) In the Version Description, enter a meaningful description for your PMML file.
    4. In the Algorithm field, accept the default. The algorithm is derived from the PMML file you have uploaded.
    5. (Optional) In the Tool drop-down list, select the tool with which you created your PMML file.
Your predictive model has been created. It is displayed in the Catalog if you have selected the Predictive Models option under Show Me.

Description of predictive_model.png follows
Description of the illustration predictive_model.png

12.2 Adding a Scoring Stage

To add a scoring stage:
  1. Open the required pipeline in Pipeline Editor.
  2. Right-click the stage after which you want to add a scoring stage, click Add a Stage, and then select Scoring.
  3. Enter a meaningful name and suitable description for the scoring stage and click Save.
  4. In the stage editor, enter the following details:
    1. Model name: Select the predictive model that you want to use in the scoring stage
    2. Model Version: Select the version of the predictive model
    3. Mapping: Select the corresponding model fields that appropriately map to the stage fields
You can add multiple scoring stages based on your use case.