CreateSpacetimeFolds-deprecated | R Documentation |
Create spatial, temporal or spatio-temporal Folds for cross validation
CreateSpacetimeFolds(x, spacevar = NA, timevar = NA, k = 10
, seed = sample(1:1000, 1))
x |
data.frame containing spatio-temporal data |
spacevar |
Character indicating which column of x identifies the spatial units (e.g. ID of weather stations) |
timevar |
Character indicating which column of x identifies the temporal units (e.g. the day of the year) |
k |
numeric. Number of folds. If spacevar or timevar is NA and a leave one location out or leave one time step out cv should be performed, set k to the number of unique spatial or temporal units. |
seed |
See |
A list that contains a list for model training and a list for model validation that can directly be used as "index" and "indexOut" in caret's train function
Hanna Meyer
Rsenal-deprecated
## Not run:
library(GSIF)
data(cookfarm)
indices <- CreateSpacetimeFolds(cookfarm$readings,"SOURCEID","Date")
str(indices)
### Prepare for leave one location out cross validation
indices <- CreateSpacetimeFolds(cookfarm$readings,spacevar="SOURCEID",
k=length(unique(cookfarm$readings$SOURCEID)))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.