Machine Learning Language

A Machine Learning Language file configures how EvoAl trains a surrogate model. A surrogate model is used in optimisation when the optimisation function is unknown or too expensive to evaluate directly. MLL files use the .mll file ending.

When to Use the Machine Learning Language

Use the Machine Learning Language when you want to:

  • Train a surrogate model from previously generated data
  • Evaluate model quality using goodness-of-fit measures, on the training data and on held-out test data
  • Store a trained model for later use in optimisation or data generation

Basic Structure

An MLL file consists of imports and a module. Inside the module, you provide five specify sections and, optionally, a use cases block:

import "definitions" from de.evoal.surrogate.ml;
import "data" from surrogate;

module training {
  specify learning-task { ... }
  specify validation steps [ ... ]
  specify preparation steps [ ... ]
  specify model 'model-name' { ... }
  specify gof begin ... end
  use cases                          // optional
    specify learning begin ... end;    // optional
    specify predicting begin ... end;  // optional
    specify testing begin ... end;     // optional
    specify resampling begin ... end;  // optional
  end
}

Each section has a distinct responsibility, described below.

Specifying the Learning Task

The specify learning-task block defines what data to learn from, which dimensions are inputs and outputs, and where to store the trained model:

specify learning-task {
  input features  'x:0', 'x:1', 'x:2'
  output features 'y:0'

  learning from  [ "data.json" ]
  testing with   [ "test.json" ]
  assessing with [ 'k-fold-cross-validation' { 'k' := 10; } ]
  serialise to   "my-model.pson" and "gof.json"
}
  • input features — the data dimensions used as inputs to the model
  • output features — the data dimensions the model is trained to predict
  • learning from — a list of data files to train from
  • testing with (optional) — a list of data files the trained model is tested on; the model never sees them while learning
  • assessing with (optional) — a list of resampling schemes that assess the learning on parts of the training data
  • serialise to — the file in which the trained model is stored, optionally followed by and and a file for the goodness-of-fit values

Specifying Validation and Preparation Steps

The specify validation steps and specify preparation steps blocks define optional pipeline steps that are run before training. They follow the same step syntax as the Generator Language. If no steps are needed, provide an empty list:

specify validation steps []
specify preparation steps []

Preparation Steps

A preparation step transforms the features it names with parameters that are fitted on the training data. Scale-sensitive models (SVR, Gaussian processes, k-nearest neighbours) usually need it. EvoAl has two steps (Han, Kamber and Pei 2012, https://doi.org/10.1016/B978-0-12-381479-1.00003-4):

Step Transformation Fitted parameters (one value per feature)
'min-max-normalisation' v’ = (v − minimum) / (maximum − minimum) · ('new-maximum' − 'new-minimum') + 'new-minimum', by default to [0, 1] minimum, maximum
'z-score-normalisation' v’ = (v − μ) / σ 'μ', 'σ' (σ divided by n)
specify preparation steps [
  step {
    component 'min-max-normalisation' {
      'features' := [data 'x:0'];
    }
  }
  step {
    component 'z-score-normalisation' {
      'features' := [data 'y:0'];
    }
  }
]
  • 'features' (quoted: features is a keyword of the MLL) is required and names features of the learning task. The step reads and writes them.
  • While learning, a step without parameters collects all training data that reaches it, fits its parameters on it and passes the transformed data on; later steps fit on the output of earlier ones. Stated parameters are kept and never fitted, e.g. a known physical range (minimum := [250.0]; maximum := [350.0];). Stating only some parameters, or a number of values other than the number of features, is an error.
  • A feature that is constant in the training data gives a warning and is only shifted.
  • Both steps are invertible. A preparation step that is not invertible must not transform an output feature (@InvertibleOnOutputs); EvoAl rejects such a module when it is loaded.

The model learns on the prepared data, so its settings refer to them, e.g. the length scale σ of a kernel refers to the prepared inputs. The SVR additionally standardises its inputs and its output itself (mean 0, standard deviation 1), so 'ε' := 0.05 always means 0.05 standard deviations of the output it learns on.

The Stored Prediction Pipeline

The model file contains everything needed to predict: the prediction pipeline with the preparation steps and their fitted parameters, 'model-prediction', and at the end the inverses of the invertible steps on output features, in reverse order. The inverse of a step is the same step with inverse true; it is derived and never written by hand. Every prediction runs this pipeline: the goodness of fit (training and test data), the generator step 'trained-model', the optimisation function and the surrogate adaption. Predictions are therefore always in the original unit of the outputs, and nothing is refitted on the data to predict.

A PSON model file without prediction pipeline is rejected; train the model again. A foreign ONNX model has no stored pipeline and predicts with the model only.

The example training.preparation of the plugin surrogate.smile trains an SVR on prepared data and predicts with it in a generator pipeline.

Model File Formats

The extension of the model file (serialise to, 'model-file') selects its format:

Format Content
.pson JSON: the model information and the state of the model (e.g. the support vectors of an SVR)
.onnx an ONNX model: the model as an ONNX graph, and the model information as JSON in the metadata of the model (key de.evoal.surrogate.configuration)

The model information is the same in both formats: the model type (it selects the reader of the file), the DL types of the training (cited by a run that uses the model), the input and output features, the prediction pipeline, and per feature the goodness-of-fit values and the data of the surrogate adaption. Other ONNX tools ignore the metadata: they run the model without the prediction pipeline.

  • Each model type has its own formats. Training a model into a format that its type does not support is rejected before the training, with the formats it supports. Every model type except gradient-boosting supports .pson; gradient-boosting supports .onnx only.
  • An ONNX file without the model information (a foreign model, e.g. exported from another tool) is read as the model type de.evoal.surrogate.api.ml.general-onnx. It predicts with the model only: no prediction pipeline, no goodness-of-fit values, no adaption data. The examples surrogate.onnx.simple and surrogate.onnx.multi of the plugin surrogate.api use such models.
  • The graph of an ONNX model has one input per input feature and one output per output feature, each named after the feature and holding one value (shape [1], [1, 1], or dynamic dimensions, which EvoAl sets to 1). Float, double, 32-bit and 64-bit integer tensors are supported. EvoAl checks the inputs and outputs when it loads the file. A model with a prediction interval (gradient-boosting) has two more outputs per output feature y: y.lower and y.upper, the bounds of the interval; its coverage is in the model information.
  • ONNX Runtime runs every model on one thread, so a model predicts the same values on every machine; with several threads, the last digits of a sum can depend on the machine.

Specifying the Model

The specify model block selects the type of model to train and provides its configuration parameters as key-value pairs:

specify model 'epsilon-svr' {
  'ε'            := 1.4;
  'soft-margin'  := 0.1;
  tolerance      := 0.15;
  'kernel'       := linear {};
}

The model name determines which algorithm is used. The available models and their parameters depend on which definition files you have imported. The following models are available:

Model name Import required Description
epsilon-svr de.evoal.surrogate.smile.ml Support vector regression
gaussian-process de.evoal.surrogate.smile.ml Gaussian process regression
gradient-boosting de.evoal.surrogate.smile.ml Gradient boosting with regression trees and a prediction interval
knn de.evoal.surrogate.knn.ml k-nearest-neighbour regression with the number of neighbours 'k'
linear-regression de.evoal.surrogate.simple.ml Linear regression
multi-model de.evoal.surrogate.ml One model of its own per part of the outputs (see below)
simple-quadratic-regression de.evoal.surrogate.simple.ml Simple quadratic regression

SVR and Gaussian processes take a kernel, e.g. gaussian { 'σ' := 0.2; } or 'matérn' { 'σ' := 0.2; 'ν' := 2.5; }:

Kernel Parameters k(u, v)
linear – uᵀv
polynomial degree d ≥ 1, scale γ, offset λ ≥ 0 (γ uᵀv + λ)^d
gaussian 'σ' > 0 exp(−‖u − v‖² / (2σ²))
laplacian 'σ' > 0 exp(−‖u − v‖ / σ)
'matérn' 'σ' > 0, 'ν' ∈ {0.5, 1.5, 2.5} Matérn kernel of smoothness ν
'thin-plate-spline' 'σ' > 0 (‖u − v‖ / σ)² log(‖u − v‖ / σ)
'hyperbolic-tangent' scale γ, offset λ (a negative λ gives a warning) tanh(γ uᵀv + λ)
pearson 'σ' > 0, 'ω' > 0 (1 + 4‖u − v‖² (2^(1/ω) − 1) / σ²)^(−ω)
hellinger – Σᵢ √(uᵢ vᵢ)
sum, product 'kernel-1', 'kernel-2' k₁ + k₂, k₁ · k₂

EvoAl checks the hyperparameters when it loads the module (see constraint annotations): a value that the library rejects, such as a degree of 0 or ν = 1.0, is an error; a value that is likely a mistake, such as a negative offset of the hyperbolic tangent kernel, is a warning. Some mistakes depend on the training data and are logged as warnings during training: an SVR whose ε is at least half the range of its standardised output, and a kNN model whose k exceeds the number of training rows, are constant. A Gaussian process with 'iterations' > 0 fits the hyperparameters of its kernel (e.g. the length scale σ) and the noise to the training data; the configured values are starting values, and the model file stores the fitted ones. A Gaussian process also gives the predictive standard deviation of its prediction, which the surrogate adaption step 'prediction-interval' uses.

Gradient Boosting with a Prediction Interval

gradient-boosting fits three gradient boosting models (Friedman 2001, 2002) of regression trees with the same attributes: one for the prediction and two quantile regressions (Koenker and Bassett 1978) for the lower and the upper bound of a prediction interval. The interval holds a new observation with the probability coverage; its width follows the noise of the data. The model has a single output and is stored as .onnx only. The example training.gradient-boosting of the plugin surrogate.smile trains one on data whose noise grows with the input.

specify model 'gradient-boosting' {
  'point-prediction'  := 'point-prediction.median';
  'number-trees'      := 100;
  shrinkage           := 0.1;
  'max-depth'         := 4;
  'max-nodes'         := 8;
  'node-size'         := 10;
  'sampling-fraction' := 0.7;
  'row-sampling'      := 'row-sampling.shared';
  coverage            := 0.9;
}
Attribute Meaning
'point-prediction' mean: the prediction model minimises the squared error; median: it fits the 0.5 quantile (robust against outliers, and it lies in the interval)
'number-trees' the number of trees of each of the three models, ≥ 1
shrinkage the weight of each tree (learning rate), in (0, 1]
'max-depth', 'max-nodes' the maximum depth (≥ 2) and number of leaves (≥ 2) of a tree
'node-size' the minimum number of training rows in a leaf, ≥ 1; the bounds are quantiles of the rows of a leaf, so a leaf needs enough of them
'sampling-fraction' the share of the training rows each tree is fitted on, drawn without replacement, in (0, 1]
'row-sampling' with 'sampling-fraction' < 1: shared, tree t of the three models sees the same rows; independent, every model draws its own rows
coverage the probability that a new observation lies in the interval, in (0, 1); the bounds are the (1 − coverage) / 2 and (1 + coverage) / 2 quantiles

The three models are fitted separately, so their values can cross at a point; EvoAl sorts them (rearrangement, Chernozhukov, Fernández-Val and Galichon 2010). With median the middle value is the prediction and the outer ones are the bounds; with mean only the bounds are sorted, and the prediction may lie outside the interval. The rows of the trees are drawn from the random stream de.evoal.surrogate.smile.ml.gradient-boosting (with independent rows, one stream per model), so a run with the same seed trains the same model.

The ONNX file holds the three models as one TreeEnsemble graph (ai.onnx.ml opset 5) in double precision; it predicts the same values as the trained model up to the last digits. The surrogate adaption step 'prediction-interval' uses the interval, and the measures picp and mpiw assess it.

Several Outputs: the Multi-Model

Most models learn one output feature. A learning task with several outputs uses a multi-model, whose parts are models of their own. Every output belongs to exactly one part. A part uses the inputs in 'inputs', a subset of the inputs of the learning task, or all of them without 'inputs':

specify model 'multi-model' {
  'parts' := [
    'model-part' {
      'inputs'  := [data 'x:0'];
      'outputs' := [data 'f:1'];
      'model'   := 'gaussian-process' { 'kernel' := gaussian { 'σ' := 0.2; }; 'noise' := 0.01; 'normalize' := true; 'tolerance' := 1e-5; 'iterations' := 0; };
    },
    'model-part' {
      'outputs' := [data 'f:2'];
      'model'   := 'gradient-boosting' { ... };
    }
  ];
}
  • The model predicts every output with its part. The predictive standard deviation and the prediction interval of an output come from its part, if the part has them, so the surrogate adaption works per output.
  • The goodness-of-fit values are stored per output, as for every model. The preparation steps of the learning task are shared by all parts.
  • A multi-model is stored as .pson. The file holds all parts: a part whose type supports .pson as its state, otherwise (gradient-boosting) as its ONNX model in Base64.
  • The example training.multi-model of the plugin surrogate.smile learns ZDT1 with a Gaussian process and gradient boosting and runs NSGA-II on the model.

Specifying Goodness-of-Fit Measures

The specify gof block lists the measures used to evaluate model quality after training:

specify gof begin
  'rmse'();
  'R²'();
end

Available measures depend on which definition files you have imported. The module de.evoal.surrogate.ml provides the following ones. They are computed for every output feature on the assessed data set (the training data while learning, the test data while testing) and stored with the model; y are the values of the data, ŷ the predictions of the model and ȳ the mean of the values.

Measure Definition Meaning
'rmse'() √(Σ(y − ŷ)² / n) Root mean squared error, in the unit of the feature
'rrse'() √(Σ(ŷ − y)² / Σ(y − ȳ)²) Root relative squared error: 0 is perfect, 1 is as good as predicting the mean
'R²'() 1 − Σ(y − ŷ)² / Σ(y − ȳ)² Coefficient of determination: 1 is perfect, 0 is as good as predicting the mean, worse models are negative
'picp'() #{L ≤ y ≤ U} / n Prediction interval coverage probability: the share of values in their interval [L, U]; close to the coverage of a well-calibrated model
'mpiw'() Σ(U − L) / n Mean prediction interval width, in the unit of the feature

rrse and R² are undefined if all values of a feature are equal; they are then not stored and a warning is logged. picp and mpiw (Khosravi et al. 2011) need a model that predicts an interval, e.g. gradient-boosting; the bounds are converted by the prediction pipeline like the prediction. For another model they are undefined, not stored, and a warning is logged. Read together: a high picp with a small mpiw is an informative interval, a high picp with a large mpiw may only be wide.

specify gof can also list calculators that describe the training data for a surrogate adaption, e.g. 'kernel-density-estimation'(0.05) or 'predictive-error'() of the de.evoal.surrogate.adaption plugin. They run only while learning, never on test data.

Stored Goodness-of-Fit Values

'store-model'() stores one entry per output feature and measure, named by the qualified name of the measure, with the value of each data set: training, after testing test, and after resampling one entry per scheme with the mean, the standard deviation, the pooled value and the values of its parts. If the learning task names a goodness-of-fit file (serialise to "model.pson" and "gof.json"), the values are written to it as JSON as well. The example surrogate.adaption-training of the de.evoal.surrogate.adaption plugin trains an SVR on the Forrester function without the points in (0.69, 0.81) and tests it on that gap (rounded; the trained model differs slightly between platforms):

{
  "y:0" : {
    "de.evoal.surrogate.ml.rmse" : { "training" : 0.19, "test" : 0.93 },
    "de.evoal.surrogate.ml.R²" : { "training" : 0.998, "test" : -3.18 }
  }
}

A value on the training data is in-sample: it shows how well the model reproduces its training data, not how well it predicts new points. The values on the test data show the latter; in the gap, the model above is worse than predicting the mean of the test data. Without test data, resampling estimates them from the training data.

Specifying Use Cases

The use cases block defines the execution scenarios learning, predicting and, optionally, testing and resampling. Each scenario is a sequence of pipeline steps and function calls. When EvoAl trains a model, it runs learning and then, if present, testing and resampling; it stores predicting with the model.

EvoAl derives everything the module leaves out from the learning task:

  • Use cases: a use case that the module does not write out gets the default shown in the sections below; testing only if the learning task has test data (testing with [...]), resampling only if it states resampling schemes (assessing with [...]). Most modules can leave out the whole use cases block.
  • Reads and writes: a standard step without reads or writes gets the features of the learning task: the loaders write the input and output features, 'model-learner' and 'assessment-data' read them, 'model-prediction' reads the input features and writes the output features.
  • Settings: a left-out attribute of a standard step gets its value from the module:

    Step Attribute Derived from
    'training-data-loader' 'training-files' learning from [...]
    'test-data-loader' 'testing-files' testing with [...]
    'model-learner' model specify model
    'model-learner' 'model-file' the model file of serialise to
    all three 'input-features' input features
    all three 'output-features' output features

A value that the module states is kept. It may be a subset of the features of the learning task, e.g. a prediction step that reads only some inputs; a feature outside the learning task (or an output feature in 'input-features') stops EvoAl with an error that names the use case, the step and the feature. EvoAl logs the effective use cases, including the derived parts, in MLL syntax.

The goodness of fit on the training data and the estimates for the surrogate adaption use the training rows that 'assessment-data' { 'data-set' := "training"; } records after the validation pipeline, i.e. the rows the model learned from. A written-out learning use case that calls 'gof-calculator'() must contain this step; otherwise EvoAl stops with an error that names the missing step. The example surrogate.adaption-validation of the plugin surrogate.adaption cuts a gap with two outliers out of the training data and shows the goodness of fit and the density of the inputs on the rows that are left.

Learning

The specify learning block defines the steps EvoAl executes when training the model. The default loads the training data, runs the validation pipeline, records the rows that pass it, runs the preparation pipeline, trains the model, evaluates the goodness of fit on the recorded rows, and stores the result:

specify learning
begin
  'execute'([
    step {
      component 'training-data-loader' {}
    },
    pipeline 'validation',
    step {
      component 'assessment-data' { 'data-set' := "training"; }
    },
    pipeline 'preparation',
    step {
      component 'model-learner' {}
    }
  ]);

  'gof-calculator'();
  'store-model'();
end;

The key components in the learning scenario are:

Component Description
training-data-loader Loads the training data ('training-files', by default the files of learning from)
assessment-data Records the rows after validation as the data set training; it keeps copies, so preparation does not change them
model-learner Trains the model on the loaded data

The key function calls after execute are:

Call Description
gof-calculator() Evaluates the goodness-of-fit measures defined in specify gof on the recorded training rows
store-model() Saves the trained model to the file specified in the learning task

A training run records its provenance and the literature of its methods in provenance/<name of the MLL file>/ in the execution folder. The model file lists the DL types of the training as definitions, so a search that uses the model cites them as well (see Provenance of a Run).

Predicting

The specify predicting block defines the steps EvoAl executes when using the trained model to make predictions. EvoAl stores them with the model as the stored prediction pipeline, with the fitted parameters of the preparation and the derived inverses after the prediction. The default runs the preparation pipeline and then applies the model:

specify predicting
begin
  pipeline 'preparation'
  step {
    component 'model-prediction' {}
  }
end;

The model-prediction component applies the trained model to the input dimensions and writes the predicted values to the output dimensions.

Testing

The specify testing block assesses the trained model on the test data of the learning task (testing with [...]). It runs after learning. If the learning task has test data and the module does not write the block out, EvoAl uses this default:

specify testing
begin
  'execute'([
    step {
      component 'test-data-loader' {}
    },
    pipeline 'validation',
    step {
      component 'assessment-data' { 'data-set' := "test"; }
    }
  ]);

  'gof-calculator'();
  'store-model'();
end;
Component / call Description
test-data-loader Loads the test data ('testing-files', by default the files of testing with)
assessment-data Collects the data as the data set named 'data-set', which the next gof-calculator() assesses
gof-calculator() Runs the goodness-of-fit measures of specify gof on the collected data
store-model() Stores the model again, now with the values of both data sets

The measures predict the outputs from the inputs of every test point and compare them with its outputs. A 'test-data-loader' without 'testing-files' in a module without testing with stops EvoAl with an error.

Resampling

The goodness of fit on the training data overstates the quality of a model: a nearest neighbour reproduces its training data exactly. A test set costs data. A resampling scheme estimates the prediction error from the training data alone: it splits the data that 'training-data-loader' loaded into parts, learns on the training rows of each part and assesses the rows it held out. The schemes are stated in the learning task (assessing with [...], DL module de.evoal.surrogate.pipeline):

Scheme Parts
'k-fold-cross-validation' { 'k' := 10; } the shuffled rows in 'k' folds whose sizes differ by at most one; each fold is held out once (Stone 1974; Arlot and Celisse 2010)
'leave-one-out-cross-validation' {} each row is held out once; R² and rrse have only a pooled value
'bootstrap' { 'repetitions' := 100; } each repetition draws as many rows as there are with replacement and holds out the rows not drawn (out of bag); a repetition without such rows is skipped (Efron 1979)
'block-cross-validation' { blocks := ...; } each block of rows is held out once, so the model predicts a region it never saw: the estimate is the extrapolation error (Roberts et al. 2017)

The blocks of a block cross-validation are required:

Blocks Meaning
'k-means-blocks' { 'k' := 5; } clusters of the inputs (min-max normalised on the training data) by k-means (Lloyd 1982) with k-means++ seeding; each non-empty cluster is a block
'grid-blocks' { intervals := 4; } the range of every input cut into equal intervals; each non-empty cell is a block (a warning is logged if there are more blocks than half the rows)
'given-blocks' { feature := data 'site'; } rows with the same value of a feature form a block; the feature is read from the training files and must not be an input or output feature

'k' is quoted because k is a keyword (the unit prefix kilo). Each scheme may be stated once, since its name is the name of its data set.

For each scheme, EvoAl derives the resampling use case unless the module writes it out:

specify resampling
begin
  'resample'('k-fold-cross-validation' { 'k' := 10; },
             [pipeline 'validation', pipeline 'preparation', step { component 'model-learner' {} }],
             [pipeline 'validation']);
  'store-model'();
end;

'resample'(scheme, learning, assessment) runs every part in an interpreter state of its own: the learning steps on the training rows (so the preparation is fitted on these rows), the assessment steps on the held-out rows, and the measures of specify gof on the rows that leave them, through the part model’s prediction pipeline. After the last part, the measures assess the held-out rows of all parts together, each with the prediction of its part’s model (pooled). The final model, its prediction pipeline and its values on the training and test data are the same as without resampling; 'store-model'() stores them again with the new values. The data set of a scheme holds, per output feature and measure, the mean, the standard deviation (divided by m − 1 for m parts), the pooled value and the values of the parts:

"de.evoal.surrogate.ml.R²" : {
  "training" : 1.0,
  "k-fold-cross-validation" : { "mean" : 0.94, "standard-deviation" : 0.05, "pooled" : 0.96, "values" : [ ... ] },
  "leave-one-out-cross-validation" : { "pooled" : 0.96, "values" : [ ] }
}

A measure that is undefined on a part (R² and rrse on a single held-out row, e.g. with leave-one-out) adds no value, and the log says on how many parts; mean and standard deviation are left out if no part has a value. The pooled value is left out if the measure is undefined on all held-out rows.

Which value to read: with k-fold, leave-one-out and block cross-validation every row is held out once, so the pooled value is the measure on the cross-validated predictions. It is the better estimate when the parts are small or homogeneous: R² and rrse of a part compare with the mean of the part’s rows, so a block of similar rows gets a strongly negative R² even for a reasonable model, and the mean of the parts’ RMSEs is not the RMSE of all predictions (Forman and Scholz 2010 show this for the F-measure). For leave-one-out, the pooled RMSE is the root of the PRESS statistic (Allen 1974) divided by the number of rows, and the pooled R² is also called Q². The standard deviation of the parts shows how much the estimate varies between parts. For the bootstrap, a row counts in the pooled value as often as it was out of bag. The splits, the bootstrap draws and the k-means seeding use random streams of the run’s seed (EVOAL_SEED), so the same seed gives the same values. The example training.resampling of the plugin surrogate.knn compares the values of a nearest neighbour on its training data with those of all four schemes.

Literature: Stone 1974, https://doi.org/10.1111/j.2517-6161.1974.tb00994.x; Arlot and Celisse 2010, https://doi.org/10.1214/09-SS054; Efron 1979, https://doi.org/10.1214/aos/1176344552; Allen 1974, https://doi.org/10.1080/00401706.1974.10489157; Forman and Scholz 2010, https://doi.org/10.1145/1882471.1882479; Roberts et al. 2017, https://doi.org/10.1111/ecog.02881; Lloyd 1982, https://doi.org/10.1109/TIT.1982.1056489.

A Complete Example

The following example trains a Gaussian process on the Forrester function from nine points with a gap around the function’s minimum, tests it on the gap, evaluates it using RMSE and R², and stores the model and the goodness of fit (example training.gaussianprocess of the plugin surrogate.smile; its generator writes the CSV files). It leaves out the use cases, so EvoAl uses the default learning, predicting and testing use cases:

import "definitions" from 'de.evoal.pipeline.base';
import "definitions" from de.evoal.surrogate.ml;
import "definitions" from 'de.evoal.surrogate.pipeline';
import "definitions" from de.evoal.surrogate.smile.ml;

import "data" from surrogate;

module 'training' {
  specify learning-task {
    input features  'x:0'
    output features 'y:0'

    learning from [ "output/left.csv", "output/right.csv" ]
    testing with  [ "output/test.csv" ]

    serialise to "output/gaussian-process.pson" and "output/gof.json"
  }

  specify validation steps []
  specify preparation steps []

  // σ and the noise are starting values; with 'iterations' > 0 they are fitted
  specify model 'gaussian-process' {
    'kernel'     := gaussian { 'σ' := 0.2; };
    'noise'      := 0.01;
    'normalize'  := true;
    'tolerance'  := 1e-5;
    'iterations' := 100;
  }

  specify gof begin
    'rmse'();
    'R²'();
  end
}