View source: R/prepareNewData.keras.R
prepareNewData.keras | R Documentation |
Prepare the prediction data according to the definition of the keras deep model's experiment
prepareNewData.keras(newdata, data.structure)
newdata |
A grid containing the prediction data. |
data.structure |
A structure, as returned by |
A named list with the components required by downscalePredict.keras in order to perform the predictions
J BaƱo-Medina
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.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.