wt_fnn: wt_fnn

Description Usage Arguments Examples

View source: R/wt_fnn.R

Description

Feedforward neural network implementation for stream water temperature prediction including Bayesian hyperparameter optimization. All results are stored automatically in the folder catchment/model_name.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
wt_fnn(
  train_data,
  test_data = NULL,
  catchment = NULL,
  model_name = NULL,
  seed = NULL,
  n_iter = 40,
  n_random_initial_points = 20,
  epochs = 100,
  early_stopping_patience = 5,
  ensemble_runs = 5,
  bounds_layers = c(1, 5),
  bounds_units = c(5, 200),
  bounds_dropout = c(0, 0.2),
  bounds_batch_size = c(5, 150),
  initial_grid_from_model_scores = TRUE
)

Arguments

train_data

Data frame containing training data created by using wt_preprocessing()

test_data

Data frame containing test data created by using wt_preprocessing()

catchment

Catchment name as string, used for storing results in current working directory.

model_name

Name of this particular model run as string, used for storing results in the catchment folder.

seed

Random seed.

n_iter

Number of iteration steps for bayesian hyperparameter optimization.

n_random_initial_points

Number of sampled initial random points for bayesian hyperparameter optimization

epochs

integer. Number of training epochs

early_stopping_patience

Integer. Early stopping patience, i.e. the number of epochs with no improvement to waite before stopping the training

ensemble_runs

Number of ensembles used for making the finel model.

bounds_layers

Vector containing the lower and upper bound of the numbers of layers used in the bayesian hyperparameter optimization.

bounds_units

Vector containing the lower and upper bound of the numbers of units used in the bayesian hyperparameter optimization.

bounds_dropout

Vector containing the lower and upper bound of the numbers of dropout used in the bayesian hyperparameter optimization.

bounds_batch_size

Vector containing the lower and upper bound of the numbers of batch size used in the bayesian hyperparameter optimization.

initial_grid_from_model_scores

logical. Should previous results be used as initial grid for the hyperparameter optimization? These have to be stored in the model_name folder under model_scores.csv

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
data(test_catchment)
wt_preprocess(test_catchment)
train_data <- feather::read_feather("test_catchment/train_data.feather")
test_data <- feather::read_feather("test_catchment/test_data.feather")

wt_fnn(train_data, test_data, "test_catchment", "standard_FNN")

## End(Not run)

MoritzFeigl/wateRtemp documentation built on Sept. 6, 2021, 6:58 a.m.