prepareNewData.keras: Prepare newdata for predictions going to be donw with a keras...

View source: R/prepareNewData.keras.R

prepareNewData.kerasR Documentation

Prepare newdata for predictions going to be donw with a keras model

Description

Prepare the prediction data according to the definition of the keras deep model's experiment

Usage

prepareNewData.keras(newdata, data.structure)

Arguments

newdata

A grid containing the prediction data.

data.structure

A structure, as returned by prepareData.keras

Value

A named list with the components required by downscalePredict.keras in order to perform the predictions

Author(s)

J BaƱo-Medina

See Also

downscaleTrain.keras for training a downscaling deep model with keras downscalePredict.keras for predicting with a keras model prepareData.keras for predictor preparation of training data downscaleR.keras Wiki

downscaleR Wiki for preparing predictors for downscaling and seasonal forecasting.

Examples


# Loading data
require(climate4R.datasets)
require(transformeR)
data("VALUE_Iberia_tas")
y <- VALUE_Iberia_tas
data("NCEP_Iberia_hus850", "NCEP_Iberia_psl", "NCEP_Iberia_ta850")
x <- makeMultiGrid(NCEP_Iberia_hus850, NCEP_Iberia_psl, NCEP_Iberia_ta850)
# We divide in train and test data and standardize the predictors 
# using transformeR functions subsetGrid and scaleGrid, respectively.
xT <- subsetGrid(x,years = 1983:1995)
xt <- subsetGrid(x,years = 1996:2002) %>% scaleGrid(base = xT, type = "standardize")
xT <- scaleGrid(xT,type = "standardize")
yT <- subsetGrid(y,years = 1983:1995)
yt <- subsetGrid(y,years = 1996:2002)
# Preparing the predictors for training...
xy.T <- prepareData.keras(x = xT, y = yT, 
                          first.connection = "conv",
                          last.connection = "dense",
                          channels = "last")
# Preparing the predictors for prediction...
xy.t <- prepareNewData.keras(newdata = xt,data.structure = xy.T)
str(xy.t)


SantanderMetGroup/downscaleR.keras documentation built on July 7, 2023, 1:22 p.m.