...
The properties of the above configuration are described below.
Property | Description |
---|---|
<model storage-location> | ML model storage location is either the file system or Registry. If the model is stored in the Registry, storage-location should have the prefix |
<name> | Name of the feature according to the generated model. |
<expression> | The XPath or JSONPath expression to extract the feature value from the payload. |
<predictionOutput property> | The message context property name, to which you need to set the prediction output value. |
...
- Log in to the WSO2 ESB management console using
admin/admin
credentials. - Click Main, and then click Proxy Service.
- Click Pass Throgh Proxy.
- Enter the details as shown below.
- Enter a name for Proxy Service Name (E.g.
PredictMediatirTestProxy
). - Enter http://localhost:9000/services/SimpleStockQuoteService for Target URL.
- Enter a name for Proxy Service Name (E.g.
Click Create . You view the proxy service created as shown below.
Tip Follow the steps below to view the source view of the proxy service configuration you added.
- Log in to the WSO2 ESB management console using
admin/admin
credentials. - Click Main, and then click List in the Services menu.
Click the corresponding Source View link of the WSDL based proxy service you added above. You view its configuration in the source view as follows.
Code Block language xml <?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="PredictMediatirTestProxy" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence> <log level="custom"> <property name="before-predict-mediator" expression="fn:concat('ML Mediator Prediction : ',get-property('result'))"/> </log> <predict> <model storage-location="/Users/praneesha/Documents/Product_Packs/ML/wso2ml-1.0.0-SNAPSHOT/samples/ml-model-usage/src/main/resources/downloaded-ml-model"/> <features> <feature name="SI2" expression="$body/features/SI2"/> <feature name="PG2" expression="$body/features/PG2"/> <feature name="Age" expression="$body/features/Age"/> <feature name="DBP" expression="$body/features/DBP"/> <feature name="BMI" expression="$body/features/BMI"/> <feature name="DPF" expression="$body/features/DPF"/> <feature name="TSFT" expression="$body/features/TSFT"/> <feature name="NumPregnancies" expression="$body/features/NumPregnancies"/> </features> <predictionOutput property="result"/> </predict> <log level="custom"> <property name="after-predict-mediator" expression="fn:concat('ML Mediator Prediction : ',get-property('result'))"/> </log> <drop/> </inSequence> <outSequence> <send/> </outSequence> <endpoint> <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> </endpoint> </target> <description/> </proxy>
- Log in to the WSO2 ESB management console using
Adding Log, Predict and Drop Mediators to the Sequence
...