
Last chance! 50% off unlimited learning
Sale ends in
plot predictions countries/regions by index
plotPrediction(regionDf, countryIndex = 1, ylog = FALSE)
A list containing a representation of the data.
num Index
logical plot log y axis (log = y)
A plot
Data are taken from the regionTrain
and regionPopulation
data sets
that were combined using the preprocessInputData
function.
regionTrain
and regionPopulation
are stored in the
babsim.data
package.
# NOT RUN {
# require(SPOT)
# data <- preprocessInputData(regionTrain, regionPopulation)
# testData <- preprocessTestData(regionTest)
# # Select the first region:
# testData <- testData[testData$Region==levels(testData$Region)[1], ]
# testData$Region <- droplevels(testData$Region)
# # Very small number of function evaluations:
# n <- 6
# res <- lapply(data[1], tuneRegionModel, pops=NULL,
# control=list(funEvals=n, designControl=list(size=5), model = buildLM))
# parsedList <- parseTunedRegionModel(res)
# pred <- generateMCPrediction(testData = testData, models = parsedList$models, write = FALSE)
# quickPredict <- cbind(pred, testData$Date, testData$Region)
# names(quickPredict) <- c("ForecastID", "confirmed", "fatalities", "date", "region")
# p <- plotPrediction(quickPredict, 1)
# }
Run the code above in your browser using DataLab