Skip to main content
POST
/
wmobo
curl --request POST \
  --url https://bbyp8wyza0.execute-api.ap-southeast-2.amazonaws.com/{basePath}/wmobo \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "beta": 2.5,
  "data": "[{\"Model Name\":\"Type\",\"Input 1\":\"Input\",\"Input 2\":\"Input\",\"Output 1\":\"Output\",\"Output 2\":\"Output\"},{\"Model Name\":\"Min\",\"Input 1\":0,\"Input 2\":0,\"Output 1\":-1,\"Output 2\":-2},{\"Model Name\":\"Max\",\"Input 1\":10,\"Input 2\":20,\"Output 1\":1,\"Output 2\":2},{\"Model Name\":\"Step\",\"Input 1\":0,\"Input 2\":0,\"Output 1\":0,\"Output 2\":0},{\"Model Name\":\"Weight\",\"Input 1\":1,\"Input 2\":1,\"Output 1\":1,\"Output 2\":-1},{\"Model Name\":\"1\",\"Input 1\":\"1.173\",\"Input 2\":\"8.222\",\"Output 1\":\"0.5\",\"Output 2\":\"1.5\"}]"
}
'
{
  "Input 1": 3.456,
  "Input 2": 18.762
}

Authorizations

Authorization
string
header
required

Auth Token from Settings & Models page in app. Must be provided as: Bearer <API Auth Token>

Body

application/json

Two values are required for the request body, with an optional third:

  1. beta: value balancing exploration (3-5) and exploitation of known good areas (0). Recommend 3
  2. data: string of an array of JSON objects defining the model table, including headers. The direction of the optimisation is defined in the Weight field.
  3. config [Optional]: Model table headers as JSON. If config is used, data contains only the data rows without headers, following the same format as described below.

data detailed definition:

When not using the config parameter to handle the model headers, the data field contains a full table, defined row by row, with two sections: the headers, defining the model, and the previous trials data. Both the headers and the previous trials data are provided to the API call as a single string.

The table column names are used as the keys to define each row as a JSON object. These JSON objects are then inserted into an array, and the array is converted to a string. This can be achieved in python by converting a Pandas DataFrame to a JSON using record-wise orientation, i.e., df.to_json(orient='records').

The columns names are: Model Name, Input 1, Input 2, ... , Input N, Output 1, Output 2, ... , Output N The header rows, in order, are: Type, Min, Max, Step, Weight

Every cell within the table must have a value. For Min, Max, and Step, the default value should be 0. For Weight, the default value should be 1. For the Type fields, the values must be "Input", "Output" or "Output Constraint".

Weight field definition: The Weight field is used to define two model parameters:

  1. The relative importance of each Output to achieving the optimisation objective (relative magnitude)
  2. The direction of the optimisation (sign)

The relative magnitude compares and scales the contribution of each Output based on the absolute value of the Weight field. For example, if there are two Outputs with Weights of -3 and 6:

  • Output 2 is considered to be twice as important as Output 1, as 6/3 = 2. Weights of 1 and -2, 5 and 10, or -4 and -8 would produce the same results.
  • For this example, Output 1 is to be minimised, as it is a negative value. Output 2 is to be maximised, as it is a positive value.

Double quotation marks (") should be used within the data string, escaped (\") to ensure correct processing in the API. Previous trial data values should be provided as strings, as shown in the example (although providing them as numbers may work fine).

The table below converts into the string shown in the Example section. There are the column titles, followed by 5 rows of headers, followed by a single row of previous trial data. There are two inputs and two outputs for this particular example model.

Model NameInput 1Input 2Output 1Output 2
TypeInputInputOutputOutput
Min00-1-2
Max102012
Step0000
Weight116-3
11.1738.2220.51.5

Schema for request body format for Multi Objective requests

beta
number
default:3
required
Required range: 0 <= x <= 6
data
string
required
config
string
Example:

"'{\"Name\":\"Model Name\",\"Input 1\": {\"Type\": \"Input\", \"Min\": 0, \"Max\": 10, \"Step\": 0, \"Weight\": 1}, \"Input 2\": {\"Type\": \"Input\", \"Min\": 0, \"Max\": 20, \"Step\": 0, \"Weight\": 1}, \"Output 1\": {\"Type\": \"Output\", \"Min\": -1, \"Max\": 1, \"Step\": 0, \"Weight\": 1}, \"Output 2\": {\"Type\": \"Output\", \"Min\": -2, \"Max\": 2, \"Step\": 0, \"Weight\": -1}}"

Response

200 response

Input 1
number
Example:

3.456

Input 2
number
Example:

18.762