wt_lm: wt_lm

Description Usage Arguments Examples

View source: R/wt_lm.R

Description

Multiple linear regression and step-wise linear regression 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
wt_lm(
  train_data,
  test_data = NULL,
  catchment = NULL,
  type = "stepLM",
  cv_mode = "repCV",
  model_name = NULL,
  no_cores = parallel::detectCores() - 1,
  seed = NULL
)

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.

type

Can be either "LM" for a multiple regression model of the form wt ~ Ta + Q, or "stepLM" for a step-wise linear regression model using all available variables and their interactions.

cv_mode

Cross-validation mode. Only relvenat when using type="stepLM". Can either be "repCV" for a 5times repeated 10-fold CV or "timeseriesCV" for a timeslice CV using intial window=730, horizon=90 and skip=60.

model_name

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

no_cores

Number of cores used for computation. If NULL parallel::detectCores() - 1 is applied.

seed

Random seed.

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_lm(train_data, test_data, "test_catchment", "stepLM", "repCV", "standard_stepLM")

## End(Not run)

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