From d4a9a5b7d23fd618d5c12d22d36eaf083560adef Mon Sep 17 00:00:00 2001 From: Brian Pondi Date: Mon, 30 Oct 2023 11:06:34 +0100 Subject: [PATCH] save ml model process graph --- R/api.R | 1 + R/processes.R | 33 +++++++++++++++++++++++++++++++++ man/save_ml_model.Rd | 16 ++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 man/save_ml_model.Rd diff --git a/R/api.R b/R/api.R index c2acd1c..58628e3 100644 --- a/R/api.R +++ b/R/api.R @@ -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 diff --git a/R/processes.R b/R/processes.R index 1014162..c27e497 100644 --- a/R/processes.R +++ b/R/processes.R @@ -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", diff --git a/man/save_ml_model.Rd b/man/save_ml_model.Rd new file mode 100644 index 0000000..4b178eb --- /dev/null +++ b/man/save_ml_model.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/processes.R +\docType{data} +\name{save_ml_model} +\alias{save_ml_model} +\title{save ml model} +\format{ +An object of class \code{Process} (inherits from \code{R6}) of length 12. +} +\usage{ +save_ml_model +} +\description{ +save ml model +} +\keyword{datasets}