evaluate()

This method evaluates one or more ML models at one or more points.

The point options are either a single point (which uses the modelPoint argument), a list of points (supplied using modelPoints), or a sweep of points (generates point sweeps as a single input parameter varied across a supplied array of values while it holds all other parameters constant).

Only provide one of modelPoint, modelPoints, or baselinePoint/sweepValues.

Supply both baselinePoint and sweepValues together. This determines the manner in which the method evaluates the model.

Providing modelPoint evaluates the specified models at a single point. Providing modelPoints evaluates the models at a list of specified points.

Providing both sweepValues and baselinePoint evaluates an array of points for each input supplied in sweepValues, in which a single input is modified at a time with all other inputs held constant at the values you provide in baselinePoint.

This page discusses:

Arguments

evalJson: Dictionary-like object containing all required request information.

This schema contains properties using both the model terminology introduced in R2025x and the older approximation terminology, for backwards compatibility.

Return Value

The structure of the return value depends on the arguments you use as follows:

  • modelPoint: Returns a nested dictionary-like object with each output value for each model at the specified point. For example:
    {"model-id-1":{
      {
        "output-id-1":1.0,
        "output-id-2":2.0
      }
    }}
    
  • modelPoints: Similar to modelPoint; however, each model-id corresponds to an array of output dictionaries. For example:
    {"model-id-1":[
      {
       "output-id-1":1.0,
       "output-id-2":2.0
      },{
       "output-id-1":1.5,
       "output-id-2":2.5
      }
    ]}
  • baselinePoint and sweepValues: Similar to modelPoint; however, rather than returning a single point value for each output parameter, it returns a dictionary-like object containing a list-like object of values corresponding to each provided sweep. For example:
    #Input argument
    Output = MLAPI.evaluate({
    "modelIds": ["model-id-1"],
     "baselinePoint": {"input-id-1": 1.0, "input-id-2":1.8},
     "sweepValues": {"input-id-1": [0.0, 0.5, 1.0, 1.5, 2.0]
    })
    
    #Output
    {"model-id-1":{
      "output-id-1":{
        "input-id-1":[5, 10, 15, 20, 25]
      },
      "output-id-2":{
        "input-id-1":[15, 110, 115, 120, 125]
      }
    }}