Skip to content

Get Model Statistics

Returns the status and other details of 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.
  • 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.
BEGIN  
   Ml_Util_API.Get_Model_Statistics(
      response_        => :response_,   -- Clob parameter to accept response data.
      dataset_id_      => :dataset_id_, -- Dataset ID for the Machine Learning Model.
      response_format_ => 'XML');       -- Response format ('XML' / 'JSON' / 'IFS_MESSAGE').
END;

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. For more details about retrieving model statistics please see the PSO Machine Learning Guide and the PSO Interface Guide.

<DsMachineLearning xmlns="http://tempuri.org/DsMachineLearning.xsd">  
  <ML_Model>  
    <id>Machine_Learning_Demo_Model</id>  
    <feature_id>feature_to_predict</feature_id>  
    <update_datetime>2021-03-18T12:00:00+00:00</update_datetime>  
    <model_status_id>10</model_status_id>  
    <algorithm>DecisionTree</algorithm>  
    <problem_type>Classification</problem_type>  
  </ML_Model>  
  <ML_Model_Range>  
    <id>0</id>  
    <feature_id>feature_to_predict</feature_id>  
    <value>WON</value>  
    <active>true</active>  
  </ML_Model_Range>  
  <ML_Model_Range>  
    <id>0</id>  
    <feature_id>input_feature_1</feature_id>  
    <value>ABC</value>  
    <active>true</active>  
  </ML_Model_Range>  
...  
  <ML_Model_Score>  
    <id>f1_macro</id>  
    <value>0.774174337284988</value>  
  </ML_Model_Score>  
  <ML_Model_Score>  
    <id>f1_weighted</id>  
    <value>0.831843645620681</value>  
  </ML_Model_Score>  
  <ML_Model_Score>  
    <id>iterations</id>  
    <value>51</value>  
  </ML_Model_Score>  
...  
  <ML_Model_Cleaning>  
    <id>e02c8e395d40457ba8336f31f2b02bd7</id>  
    <feature_id>input_feature_1</feature_id>  
    <label>OTHER</label>  
    <cleaning_type_id>label_counts_too_low</cleaning_type_id>  
  </ML_Model_Cleaning>  
</DsMachineLearning>

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