Machine Learning Stage

The Machine Learning query pipeline stage uses a compiled machine learning model
to analyze a field or fields of a Query Request object and stores the results of analysis
in a new field added to either the Request or the PipelineContext object.
You must use Spark’s MLlib API
to create a supervised machine learning model and upload this model into Fusion’s blob store collection.
Complete details are available in section: Machine Learning Models in Fusion

Successful use of this stage requires a proper understanding of both the model and your data.
The machine learning model is described by its spark-mllib.json file,
which contains the model specification as a JSON object.
This object contains attribute "featureFields" which takes as its value a list of one of more field names.
The contents of these fields are processed into the vector of features which the model operates on.
If these fields aren’t present in the request, then the result is either an empty prediction
or a configurable default value.
If the contents of these fields differ greatly from the data used to compile the model,
the predictions made by the model will be unreliable.

Configuration

Tip

When entering configuration values in the UI, use unescaped characters, such as \t for the tab character. When entering configuration values in the API, use escaped characters, such as \\t for the tab character.

When using Fusion's REST-API, the ID of this stage is: machine-learning-query.

Configuration Properties

Property

Description, Type

defaultValue

Default Value

Value to provide if a prediction cannot be made for a document.

type: string

failOnError

Fail on Error

Flag to indicate if this stage should throw an exception if an error occurs while generating a prediction for a document.

type: boolean

default value: 'false'

modelId

Machine Learning Model ID

required

The ID of the ML model stored in the Fusion blob store.

type: string

minLength: 1

predictionFieldName

Prediction Field Name

required

Name of the field to store the prediction (model output) in the document.

type: string

minLength: 1

queryFeatureFieldName

Query Feature Field

Name of the field to extract query features from (model input) in the document.

type: string

default value: 'q'

minLength: 1

storeInContext

Store the Prediction in the Context

Flag to indicate that the prediction should be set as a context property instead of setting a field on the document.