Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The properties of the above configuration are described below.

PropertyDescription
<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 registry:

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

...

  1. Log in to the WSO2 ESB management console using admin/admin credentials.
  2. Click Main, and then click Proxy Service.
  3. Click Pass Throgh Proxy.
  4. 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.
  5.   Click  Create . You view the proxy service created as shown below.
    proxy services listImage Modified

    Tip

    Follow the steps below to view the source view of the proxy service configuration you added.

    1. Log in to the WSO2 ESB management console using admin/admin credentials.
    2. Click Main, and then click List in the Services menu.
    3. 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
      languagexml
      <?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>                    

Adding Log, Predict and Drop Mediators to the Sequence

...