Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load/Save ML model #300 #304

Merged
merged 5 commits into from
Mar 9, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions meta/subtype-schemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@
}
}
},
"ml-model": {
"type": "object",
"subtype": "ml-model",
"title": "Machine Learning Model",
"description": "A machine learning model accompanied with STAC metadata, including the ml-model extension."
},
"output-format": {
"type": "string",
"subtype": "output-format",
Expand Down
44 changes: 44 additions & 0 deletions proposals/load_ml_model.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"id": "load_ml_model",
"summary": "Load a machine learning model",
"description": "...",
"categories": [
"machine learning",
"import"
],
"experimental": true,
"parameters": [
{
"name": "id",
"description": "The STAC Item to load the machine learning model from. The STAC Item must implement the ml-model extension. Such model can be trained with processes such as ``fit_random_forest()``.",
"schema": [
{
"title": "URL",
"type": "string",
"format": "uri",
"subtype": "uri",
"pattern": "^https?://"
},
{
"title": "Batch Job ID",
"type": "string",
"subtype": "job-id",
"pattern": "^[\\w\\-\\.~]+$"
},
{
"title": "User-uploaded File",
"type": "string",
"subtype": "file-path",
"pattern": "^[^\r\n\\:'\"]+$"
}
]
}
],
"returns": {
"description": "A machine learning model to be used with machine learning processes such as ``predict_random_forest()``.",
"schema": {
"type": "object",
"subtype": "ml-model"
}
}
}
36 changes: 36 additions & 0 deletions proposals/save_ml_model.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"id": "save_ml_model",
"summary": "Save a machine learning model",
"description": "...",
"categories": [
"machine learning",
"import"
],
"experimental": true,
"parameters": [
{
"name": "data",
"description": "The data to store as a machine learning model.",
"schema": {
"type": "object",
"subtype": "ml-model"
}
},
{
"name": "options",
"description": "Any additional parameters to create the file(s).",
"schema": {
"type": "object",
"additionalParameters": false
},
"default": {},
"optional": true
}
],
"returns": {
"description": "Returns `false` if the process failed to store the model, `true` otherwise.",
"schema": {
"type": "boolean"
}
}
}