Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
New Processes
These two new Processes
train_model
andapply_prediction
form the base for machine-learning inopeneocubes
.train_model
allows to train different models (that are supported in the packagecaret
) withopeneocubes
and store the trained models as.rds
-files in the workspace ofopeneocubes
.apply_prediciton
uses these models and the functionapply_pixel()
from thegdalcubes
package to apply the machine-learning model to each pixel of a datacube build withopeneocubes
.New File Formats
This PR also introduces the support to save outputs of
openeocubes
as.rds
-files. This can be trained models, but also the "proxy-datacubes" returned bygdalcubes
can be saved this way.The trained models can be downloaded via any OpenEO-Client.
New Code Layout
These changes also propose a new style for the management of the source code in this repository. Instead of storing all processes in one file (e.g.
processes.R
) each Process now has its own.R
file. Also every Process is now split into two parts. The operation and the Process. Theoperation
is the actual R-function that is accessed byopeneocubes
Process-Manager. I suggest to "suffix" the function name with "_opp" to indicate, that it's a function corresponding to a openeoccubes-Process and shouldn't be used on it's own.The
operation
is then attached to the process-object, to ensure each process works as it's used to in older versions ofopeneocubes
.Why?
Currently
openeocubes
doesn't support machine-learning on datacubes. This PR proposes a first draft for the RandomForest machine-learning-algorithm and a preliminary design, that should be refined for other coming machine-learning algorithems. It also implements the support of.rds
file downloads to access the trained models on the users local device to further support reusability of the created models.It also proposes a new style for the Code layout, to make it more readable and better testable with formal testing methods (Unittests).