Skip to content

Inference Request

Makes an Inference Request for a Machine Learning Model.

Prerequisite is to have a Machine Learning Model defined and deployed and a dataset record set up in Machine Learning Models page.

The method accepts the following parameters:

  • response_, out parameter of type CLOB, to which the response will be written.
  • features_attr_, required parameter to specify the features and their values for the request. The format is Attribute String.
  • dataset_id_, required parameter to specify the Dataset ID for the Machine Learning Model.
  • response_format_, optional parameter to specify the response format. Possible values are 'XML', 'JSON' and 'IFS_MESSAGE'. If not specified 'IFS_MESSAGE' will be used as the default format.
  • explain_results_, optional Boolean parameter to specify whether to output inference explanation data.
   features_attr_ VARCHAR2(32000);  
   -- Construct attribute string with the features and their values for the Inference Request.   
   Client_SYS.Add_To_Attr('input_feature_1', '<My Feature 1 value>', features_attr_);  
   Client_SYS.Add_To_Attr('input_feature_2', '<My Feature 2 value>', features_attr_);  

      response_        => :response_,      -- Clob parameter to accept response data.
      features_attr_   => features_attr_,  -- Features and their values in attribute string format.
      dataset_id_      => :dataset_id_,    -- Dataset ID for the Machine Learning Model.
      response_format_ => 'XML',           -- Response format ('XML' / 'JSON' / 'IFS_MESSAGE').
      explain_results_ => FALSE );         -- Indicate whether to output explanation data.

For the above call, the response may look as following. The response may vary depending on the IFS Planning & Scheduling Optimization (PSO) version being used.

<DsMachineLearning xmlns="">  

Tip: The IFS Message response format ('IFS_MESSAGE') allows using existing methods in Message_SYS package to handle the response which may be simpler to use in the PL/SQL code than 'XML' or 'JSON'.

For more details about the inference request please see the PSO Machine Learning Guide and the PSO Interface Guide.