Table of Contents | ||
---|---|---|
|
...
There are two possible Siddhi query syntaxes to use the extension in an execution plan as follows.
<double|float|long|int|string|boolean>
predict(<string>
pathToMLModel, <string> dataType)- Extension Type: StreamProcessor
- Description: Returns an output event with the additional attribute with the response variable name of the model, set with the predicted value, using the feature values extracted from the input event.
- Parameter: pathToMLModel: The file path or the registry path where ML model is located. If the model storage location is registry, the value of this this parameter should have the prefix “
registry:
” Parameter: dataType: Data type of the predicted value (double, float, long, integer/int, string, boolean/bool).
Example:
predict(‘registry:/_system/governance/mlmodels/indian-diabetes-model’)
<double|float|long|int|string|boolean>
predict(<string>
pathToMLModel, <string> dataType,<double>
input)- Extension Type: StreamProcessor
- Description: Returns an output event with the additional attribute with the response variable name of the model, set with the predicted value, using the feature values extracted from the input event.
- Parameter: pathToMLModel: The file path or the registry path where ML model is located. If the model storage location is registry, the value of this parameter should have the prefix “
registry:
” Parameter: dataType: Data type of the predicted value (double, float, long, integer/int, string, boolean/bool).
Parameter: input: A variable attribute value of the input stream which is sent to the ML model as feature values for predictions. Function does not accept any constant values as input parameters. You can have multiple input parameters.
Example:
predict(‘registry:/_system/governance/mlmodels/indian-diabetes-model’, NumPregnancies, TSFT, DPF, BMI, DBP, PG2, Age, SI2)
...
- Download WSO2 ML, and start the server. For instructions, see Getting Started.
- Generate a model using WSO2 ML which you will use to make the predictions. For instructions on generating a model in WSO2 ML, see Generating Models.
- Download WSO2 CEP, and start the server. For instructions, see Getting Started.
- Download the <P2 repository> with the required features, unzip it into a local directory on your machine.
Installing required features in WSO2 CEP
...
- Log in to the WSO2 CEP management console using admin/admin credentials and the following URL: https://<CEP_HOME>:<CEP_PORT>/carbon/
- Click Configure, and then click Features.
- Click Repository Management, and then click Add Repository.
Enter the details as shown below to add a new the Carbon P2 repository.
Tip Enter the folder path of the unzipped P2 repository directory which you downloaded and saved when setting up the prerequisites, for Local of Location in the below screen.
- Click Add.
- Click Available Features tab, and select the repository added in the previous step.
Deselect the Group features by category option.
Click Find Features. It can take a while to list out all the available features in the feature repository. Once listed, select the following features.
Machine Learner Core
Machine Learner Commons
Machine Learner Database Service
Metrics GroupML Siddhi Extension
Tip If you can't see this feature, retry with one of the following suggestions:
- Try adding a more recent P2 repository. The repository you added could be deprecated.
- Check for the feature in the Installed Features tab.
Once the features are selected, click Install to proceed with the installation.
- Click Next, and then select I accept the terms of the license agreement.
- Once the installation is completed, click Restart Now, and click Yes in the message which pops up.
...