Skip to content

Commit

Permalink
save ml model process graph
Browse files Browse the repository at this point in the history
  • Loading branch information
PondiB committed Oct 30, 2023
1 parent 1161560 commit d4a9a5b
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions R/api.R
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ addEndpoint = function() {
Session$assignProcess(ml_regularize_data_cube)
Session$assignProcess(ml_fit_class_random_forest)
Session$assignProcess(ml_predict)
Session$assignProcess(save_ml_model)
Session$assignProcess(save_result)

# assign math processes
Expand Down
33 changes: 33 additions & 0 deletions R/processes.R
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,39 @@ ml_predict <- Process$new(
}
)

#' save ml model
save_ml_model <- Process$new(
id = "save_ml_model",
description = "Saves a machine learning model as part of a batch job.The model will be accompanied by a separate STAC Item that implements the [ml-model extension](https://github.com/stac-extensions/ml-model).",
categories = as.array("machine learning", "import"),
summary = "Save a ML model",
parameters = list(
Parameter$new(
name = "data",
description = "The data to save.",
schema = list(
type = "object",
subtype = "ml-model"
)
),
Parameter$new(
name = "options",
description = "Additional parameters to create the file(s).",
schema = list(
type = "object"
),
optional = TRUE
)
),
returns = list(
description = "false if saving failed, true otherwise.",
schema = list(type = "boolean")
),
operation = function(data, format, options = NULL, job) {
# TO DO
}
)

#' save result
save_result <- Process$new(
id = "save_result",
Expand Down
16 changes: 16 additions & 0 deletions man/save_ml_model.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d4a9a5b

Please sign in to comment.