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

New definitions for fit_curve and predict_curve #420

Merged
merged 6 commits into from
Apr 29, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated the processes based on the subtypes `raster-cube` or `vector-cube` to work with the subtype `datacube` instead. [#68](https://github.com/Open-EO/openeo-processes/issues/68)
- `sort` and `order`: The ordering of ties is not defined anymore. [#409](https://github.com/Open-EO/openeo-processes/issues/409)
- `quantiles`: Parameter `probabilities` provided as array must be in ascending order. [#297](https://github.com/Open-EO/openeo-processes/pull/297)
- `fit_curve` and `predict_curve`: Heavily modified specifications. `fit_curve` works on arrays instead of data cubes, `predict_curve` doesn't support gap filling anymore, clarify no-data handling, ... [#425](https://github.com/Open-EO/openeo-processes/issues/425)

### Removed

Expand Down
63 changes: 29 additions & 34 deletions proposals/fit_curve.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,33 @@
{
"id": "fit_curve",
"summary": "Curve fitting",
"description": "Use non-linear least squares to fit a model function `y = f(x, parameters)` to data.\n\nThe process throws an `InvalidValues` exception if invalid values are encountered. Valid values are finite numbers (see also ``is_valid()``).",
"description": "Use non-linear least squares to fit a model function `y = f(x, parameters)` to data.",
"categories": [
"cubes",
"arrays",
"math"
],
"experimental": true,
"parameters": [
{
"name": "data",
"description": "A data cube.",
"description": "An array.",
"schema": {
"type": "object",
"subtype": "datacube"
"type": "array",
"items": {
"type": "number"
}
m-mohr marked this conversation as resolved.
Show resolved Hide resolved
}
},
{
"name": "parameters",
"description": "Defined the number of parameters for the model function and provides an initial guess for them. At least one parameter is required.",
"schema": [
{
"type": "array",
"minItems": 1,
"items": {
"type": "number"
}
},
{
"title": "Data Cube with optimal values from a previous result of this process.",
"type": "object",
"subtype": "datacube"
"schema": {
"type": "array",
"minItems": 1,
"items": {
"type": "number"
}
]
}
},
{
"name": "function",
Expand All @@ -45,7 +40,10 @@
"name": "x",
"description": "The value for the independent variable `x`.",
"schema": {
"type": "number"
"type": [
"number",
"null"
]
}
},
{
Expand All @@ -69,26 +67,23 @@
}
},
{
"name": "dimension",
"description": "The name of the dimension for curve fitting. Must be a dimension with labels that have a order (i.e. numerical labels or a temporal dimension). Fails with a `DimensionNotAvailable` exception if the specified dimension does not exist.",
"name": "ignore_nodata",
"description": "Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to `false` considers no-data values so that `null` is passed to the model function.",
"schema": {
"type": "string"
}
"type": "boolean"
},
"default": true,
"optional": true
}
],
"returns": {
"description": "A data cube with the optimal values for the parameters.",
"description": "An array with the optimal values for the parameters.",
"schema": {
"type": "object",
"subtype": "datacube"
}
},
"exceptions": {
"InvalidValues": {
"message": "At least one of the values is not a finite number."
},
"DimensionNotAvailable": {
"message": "A dimension with the specified name does not exist."
"type": "array",
"minItems": 1,
"items": {
"type": "number"
}
}
}
}
19 changes: 3 additions & 16 deletions proposals/predict_curve.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
{
"id": "predict_curve",
"summary": "Predict values",
"description": "Predict values using a model function and pre-computed parameters. The process is primarily intended to compute values for new labels, but it can also fill gaps where existing labels contain no-data (`null`) values.",
"description": "Predict values using a model function and pre-computed parameters. The process is intended to compute values for new labels.",
"categories": [
"cubes",
"math"
],
"experimental": true,
"parameters": [
{
"name": "data",
"description": "A data cube to predict values for.",
"schema": {
"type": "object",
"subtype": "datacube"
}
},
{
"name": "parameters",
"description": "A data cube with optimal values, e.g. computed by the process ``fit_curve()``.",
Expand Down Expand Up @@ -60,7 +52,7 @@
},
{
"name": "dimension",
"description": "The name of the dimension for predictions. Fails with a `DimensionNotAvailable` exception if the specified dimension does not exist.",
"description": "The name of the dimension for predictions.",
"schema": {
"type": "string"
}
Expand Down Expand Up @@ -98,15 +90,10 @@
}
],
"returns": {
"description": "A data cube with the predicted values.",
"description": "A data cube with the predicted values with the provided dimension `dimension` having as many labels as provided through `labels`.",
"schema": {
"type": "object",
"subtype": "datacube"
}
},
"exceptions": {
"DimensionNotAvailable": {
"message": "A dimension with the specified name does not exist."
}
}
}