model_apply
Predictions, probabilities or transforms, the feature schema checked.
Flags
| Flag | Value |
|---|---|
| Kind | apply: uses a fitted value on a table |
| Rows | keeps the rows |
| Deterministic | yes |
| Order matters | no |
| Decomposable | yes |
| Makes | a table value |
Parameters
| Parameter | Type | Required | Notes |
|---|---|---|---|
model |
reference | yes | A value's reference. |
table |
reference | yes | A value's reference. |
response_format |
"concise" | "detailed" | no | The byte budget: 64 KiB concise, 512 KiB detailed. |
Example
Over the example tables reg; ${input:name} is an input's reference and ${verb} the value an earlier call made.
split_make {
"table": "${input:reg}",
"kind": "random",
"seed": 7
}
model_fit {
"table": "${input:reg}",
"split": "${split_make}",
"family": "linear",
"target": "y",
"features": [
"f0",
"f1",
"f2",
"f3",
"f4"
]
}
model_apply {
"model": "${model_fit}",
"table": "${input:reg}"
}Result
300 rows scored
{
"ref": "sha256:894606c0bcac0c7990a6aaf6d813611c3c3ad60fb514be1712e3c547e362acff",
"kind": "table",
"rows": 300,
"schema": {
"fields": [
{
"name": "f0",
"type": {
"kind": "float64"
},
"nullable": false,
"metadata": {}
},
{
"name": "f1",
"type": {
"kind": "float64"
},
"nullable": false,
"metadata": {}
},
{
"name": "f2",
"type": {
"kind": "float64"
},
"nullable": false,
"metadata": {}
},
{
"name": "f3",
"type": {
"kind": "float64"
},
"nullable": false,
"metadata": {}
},
{
"name": "f4",
"type": {
"kind": "float64"
},
"nullable": false,
"metadata": {}
},
{
"name": "y",
"type": {
"kind": "float64"
},
"nullable": false,
"metadata": {}
},
{
"name": "prediction",
"type": {
"kind": "float64"
},
"nullable": false,
"metadata": {}
}
],
"metadata": {}
}
}Diagnostics
A refusal comes back as ok: false with coded diagnostics; every code, with its fix, is on the diagnostics page. A parameter that does not match the schema above is ARG_INVALID, with the parameter's path.