hanaml.MLPRegressor.Rdhanaml.MLPRegressor is a R wrapper for SAP HANA PAL Multi-layer Perceptron algorithm for Regression.
hanaml.MLPRegressor( data = NULL, key = NULL, features = NULL, label = NULL, formula = NULL, hidden.layer.size = NULL, activation = NULL, output.activation = NULL, learning.rate = NULL, momentum = NULL, training.style = NULL, max.iter = NULL, normalization = NULL, weight.init = NULL, thread.ratio = NULL, categorical.variable = NULL, batch.size = NULL, resampling.method = NULL, evaluation.metric = "RMSE", fold.num = NULL, repeat.times = NULL, param.search.strategy = NULL, random.search.times = NULL, random.state = NULL, timeout = NULL, progress.indicator.id = NULL, parameter.range = NULL, parameter.values = NULL )
| data |
|
|---|---|
| key |
|
| features |
|
| label |
|
| formula |
|
| hidden.layer.size |
|
| activation |
|
| output.activation |
|
| learning.rate |
|
| momentum |
|
| training.style |
|
| max.iter |
|
| normalization |
|
| weight.init |
|
| thread.ratio |
|
| categorical.variable |
|
| batch.size |
|
| resampling.method |
|
| evaluation.metric |
|
| fold.num |
|
| repeat.times |
|
| param.search.strategy |
|
| random.search.times |
|
| random.state |
|
| timeout |
|
| progress.indicator.id |
|
| parameter.range |
|
| parameter.values |
|
A "MLPRegressor" object with the following attributes:
model: DataFrame
ROW_INDEX - model row index.
MODEL_CONTENT - model content.
log: DataFrame
ITERATION - iteration number.
ERROR - Mean squared error between predicted values
and target values for each iteration.
statistics: DataFrame
STAT_NAME - statistics name.
STAT_VALUE - values of the statistics.
optim.param: DataFrame
Optimal parameters selected.
Input DataFrame df:
> df$Collect()
V000 V001 V002 V003 T001 T002 T003
1 1 1.71 AC 0 12.7 2.8 3.06
2 10 1.78 CA 5 12.1 8.0 2.65
3 17 2.36 AA 6 10.1 2.8 3.24
4 12 3.15 AA 2 28.1 5.6 2.24
5 7 1.05 CA 3 19.8 7.1 1.98
6 6 1.50 CA 2 23.2 4.9 2.12
7 9 1.97 CA 6 24.5 4.2 1.05
8 5 1.26 AA 1 13.6 5.1 2.78
9 12 2.13 AC 4 13.2 1.9 1.34
10 18 1.87 AC 6 25.5 3.6 2.14
Training the model:
> mlpr <- hanaml.MLPRegressor(data = df,
label= c("T001", "T002", "T003"),
hidden.layer.size = c(10,5),
activation = "SIN-ASYMMETRIC",
output.activation = "SIN-ASYMMETRIC",
learning.rate = 0.001, momentum = 0.00001,
training.style = "batch",
max.iter = 10000, normalization = "z-transform",
weight.init = "normal", thread.ratio = 0.3)
Training result may look different from the following results due to model randomness.
> mlpr$train.log$Collect()
ITERATION ERROR
1 1 34.525655
2 2 82.656301
3 3 67.289241
4 4 162.768062
5 5 38.988242
6 6 142.239468
7 7 34.467742
.. ... ...
732 732 11.891081
733 733 11.891081
734 734 11.891081
735 735 11.891081