Skip to main content
POST
/
sobo
curl --request POST \
  --url https://bbyp8wyza0.execute-api.ap-southeast-2.amazonaws.com/{basePath}/sobo \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "beta": 2.5,
  "opt_sel": 1,
  "data": "[{\"Model Name\": \"Type\", \"Input 1\": \"Input\", \"Input 2\": \"Input\", \"Output 1\": \"Output\"}, {\"Model Name\": \"Min\", \"Input 1\": 0, \"Input 2\": 0, \"Output 1\": -1}, {\"Model Name\": \"Max\", \"Input 1\": 10, \"Input 2\": 20, \"Output 1\": 1},{\"Model Name\": \"Step\", \"Input 1\": 0, \"Input 2\": 0, \"Output 1\": 0}, {\"Model Name\": \"Weight\", \"Input 1\": 1, \"Input 2\": 1, \"Output 1\": 1}, {\"Model Name\": \"1\", \"Input 1\": \"6.239\", \"Input 2\": \"19.446\", \"Output 1\": \"0.3\"}]"
}
'
{
  "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

Three values are required for the request body, with an optional fourth:

  1. beta: value balancing exploration (3-5) and exploitation of known good areas (0). Recommend 3
  2. opt_sel: binary value defining direction of optimisation. 1 = maximisation, 2 = minimisation
  3. data: string of an array of JSON objects defining the model table, including headers
  4. 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 table, defined row by row, which contains 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 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. Weight is not used for single objective optimisation requests, but must be included in the table regardless. For the Type fields, the values must be "Input", "Output" or "Output Constraint".

Double quotation marks (") should be used within the 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 one output for this particular example model.

Model NameInput 1Input 2Output 1
TypeInputInputOutput
Min00-1
Max10201
Step000
Weight111
16.23919.4460.3

Schema for request body format for Single Objective requests

beta
number
default:3
required
Required range: 0 <= x <= 6
opt_sel
integer
default:1
required
Required range: 1 <= x <= 2Must be a multiple of 1
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