Sensei Machine Learning API guide appendix
The following sections provide reference information for various features of the Sensei Machine Learning API.
Query parameters for asset retrieval query
The Sensei Machine Learning API provides support for query parameters with retrieving assets. Available query parameters and their usages are described in the following table:
start
start=0
limit
limit=25
orderby
orderby=created
property
property=deleted==false
Python CPU and GPU configurations cpu-gpu-config
Python Engines have the ability to choose between either a CPU or a GPU for its training or scoring purposes, and is defined on an MLInstance as a task specification (tasks.specification
).
The following is an example configuration that specifies using a CPU for training and a GPU for scoring:
[
{
"name": "train",
"parameters": [
{
"key": "training parameter",
"value": "parameter value"
}
],
"specification": {
"type": "ContainerTaskSpec",
"cpus": "1"
}
},
{
"name": "score",
"parameters": [
{
"key": "scoring parameter",
"value": "parameter value"
}
],
"specification": {
"type": "ContainerTaskSpec",
"gpus": "1"
}
}
]
cpus
and gpus
does not signify the number of CPUs or GPUs, but rather the number of physical machines. These values are permissibly "1"
and will throw an exception otherwise.PySpark and Spark resource configurations resource-config
Spark Engines have the ability to modify computational resources for training and scoring purposes. These resources are described in the following table:
Resources can be specified on an MLInstance as either (A) individual training or scoring parameters, or (B) within an additional specifications object (specification
). For example, the following resource configurations are the same for both training and scoring:
[
{
"name": "train",
"parameters": [
{
"key": "driverMemory",
"value": "2048"
},
{
"key": "driverCores",
"value": "1"
},
{
"key": "executorMemory",
"value": "2048"
},
{
"key": "executorCores",
"value": "2"
},
{
"key": "numExecutors",
"value": "3"
}
]
},
{
"name": "score",
"parameters": [
{
"key": "scoring parameter",
"value": "parameter value"
}
],
"specification": {
"type": "SparkTaskSpec",
"name": "Spark Task name",
"className": "Class name",
"driverMemoryInMB": 2048,
"driverCores": 1,
"executorMemoryInMB": 2048,
"executorCores": 2,
"numExecutors": 3
}
}
]