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\"}]",
  "explore_mode": false
}
'
{
  "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 additional optional parameters:

  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.
  5. explore_mode [Optional, default = True]: Specify if this iteration is to be run in explore mode or not. Explore mode forces suggested candidates to be more than 1% different (when normalised) from existing data points in all input parameter axes.

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" (max 1 Output Constraint, unlimited Inputs and Outputs).

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}}"

explore_mode
boolean
default:true

Enable or disable exploration mode for the current iteration of the given deker model. Exploration mode forces suggested candidates to be more than 1% different in all input parameter values than any previous data points, based on normalised input data values. Exploration mode is highly valuable when first exploring an unknown problem. Disabling allows improved optimisation around the best value found so far, although other points may still be suggested. Exploration mode can be switched on and off with each iteration as needed.

Response

200 response

Input 1
number
Example:

3.456

Input 2
number
Example:

18.762