6.3 Using Machine Learning Models for Scoring and Prediction

The predictive model is an algorithm that you apply to streaming data to predict outcomes. In a pipeline, you use a predictive model in a scoring stage to do probability scoring.

In GoldenGate Stream Analytics, a predictive model is a PMML or an ONNX file, that you upload and store in the system:
  • GGSA supports PMML versions 3.0, 3.1, 3.2, 4.0, and 4.1.

  • GGSA supports ONNX models with single-dimensional outputs of size 1. The output should be of int, float, double or Boolean datatype.

6.3.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 and click Next :
    • Name
    • Description
    • Tags
    • Predictive Model Type: Select a model type from the drop-down list.
  1. On the Predictive Model Details, enter the following details and click Save:
    1. For Predictive Model URL, upload your PMML or ONNX 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 model.
    4. In the Algorithm field, accept the default. The algorithm is derived from the model you have uploaded.
    5. (Optional) In the Tool drop-down list, select the tool with which you created your model.

6.3.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.