Skip to content

Commit 5e27496

Browse files
committed
Variant 2?
1 parent 8e85e86 commit 5e27496

File tree

3 files changed

+40
-42
lines changed

3 files changed

+40
-42
lines changed

proposals/load_ml_model.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@
1919
"subtype": "uri",
2020
"pattern": "^https?://"
2121
},
22-
{
23-
"title": "Batch Job ID",
24-
"description": "Loading a model by batch job ID is possible only if a single model has been saved by the job. Otherwise, you have to load a specific model from a batch job by URL.",
25-
"type": "string",
26-
"subtype": "job-id",
27-
"pattern": "^[\\w\\-\\.~]+$"
28-
},
2922
{
3023
"title": "User-uploaded File",
3124
"type": "string",

proposals/predict_ml_model.json

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
{
22
"id": "predict_ml_model",
33
"summary": "Predict values values using a ML model",
4-
"description": "Applies a machine learning model to an array and predicts a value/class for it.",
4+
"description": "Applies a machine learning model to a datacube and predicts values/classes for it.",
55
"categories": [
6-
"machine learning",
7-
"reducer"
6+
"machine learning"
87
],
98
"experimental": true,
109
"parameters": [
1110
{
1211
"name": "data",
13-
"description": "An array of numbers.",
12+
"description": "The input data cube.",
1413
"schema": {
15-
"type": "array",
16-
"items": {
17-
"type": [
18-
"number",
19-
"null"
20-
]
21-
}
14+
"type": "object",
15+
"subtype": "datacube"
2216
}
2317
},
2418
{
@@ -28,15 +22,25 @@
2822
"type": "object",
2923
"subtype": "ml-model"
3024
}
25+
},
26+
{
27+
"name": "dimension",
28+
"description": "The name of the dimension that the model applies to. Fails with a `DimensionNotAvailable` exception if the specified dimension does not exist.",
29+
"schema": {
30+
"type": "string"
31+
}
3132
}
3233
],
3334
"returns": {
34-
"description": "The predicted value. Returns `null` if any of the given values in the array is a no-data value.",
35+
"description": "The data cube with the predicted values. It removes the specified dimension.",
3536
"schema": {
36-
"type": [
37-
"number",
38-
"null"
39-
]
37+
"type": "object",
38+
"subtype": "datacube"
39+
}
40+
},
41+
"exceptions": {
42+
"DimensionNotAvailable": {
43+
"message": "A dimension with the specified name does not exist."
4044
}
4145
}
4246
}
Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
{
22
"id": "predict_ml_model_probabilities",
33
"summary": "Predict class probabilities using a ML model",
4-
"description": "Applies a machine learning model to an array and predicts (class) probabilities for them.",
4+
"description": "Applies a machine learning model to a data cube and predicts (class) probabilities.",
55
"categories": [
6-
"machine learning",
7-
"reducer"
6+
"machine learning"
87
],
98
"experimental": true,
109
"parameters": [
1110
{
1211
"name": "data",
13-
"description": "An array of numbers.",
12+
"description": "The input data cube.",
1413
"schema": {
15-
"type": "array",
16-
"items": {
17-
"type": [
18-
"number",
19-
"null"
20-
]
21-
}
14+
"type": "object",
15+
"subtype": "datacube"
2216
}
2317
},
2418
{
@@ -28,18 +22,25 @@
2822
"type": "object",
2923
"subtype": "ml-model"
3024
}
25+
},
26+
{
27+
"name": "dimension",
28+
"description": "The name of the dimension that the model applies to. Fails with a `DimensionNotAvailable` exception if the specified dimension does not exist.",
29+
"schema": {
30+
"type": "string"
31+
}
3132
}
3233
],
3334
"returns": {
34-
"description": "The predicted (class) probabilities. Returns `null` if any of the given values in the array is a no-data value.",
35+
"description": "A data cube with the predicted (class) probabilities. It removes the specified dimension and adds a dimension for the class probabilities. It has the name `probabilities` and is of type `other`.",
3536
"schema": {
36-
"type": "array",
37-
"items": {
38-
"type": [
39-
"number",
40-
"null"
41-
]
42-
}
37+
"type": "object",
38+
"subtype": "datacube",
39+
"dimensions": [
40+
{
41+
"type": "other"
42+
}
43+
]
4344
}
4445
}
4546
}

0 commit comments

Comments
 (0)