View source: R/ewsnet_predict.R
ewsnet_predict | R Documentation |
Communicates with EWSNet (https://ewsnet.github.io), a deep learning framework for modelling and anticipating regime shifts in dynamical systems, and returns the model's prediction for the inputted univariate time series.
ewsnet_predict(
x,
scaling = TRUE,
ensemble = 25,
envname,
weights_path = default_weights_path()
)
x |
A numeric vector of values to be tested. |
scaling |
Boolean. If |
ensemble |
A numeric value stating the number of models to average over. Options range from 1 to 25. |
envname |
A string naming the Python environment prepared by |
weights_path |
A string naming the path to model weights installed by |
A dataframe of EWSNet predictions. Values represent the estimated probability that the quoted event will occur.
#A dummy dataset of a hedgerow bird population
#monitored over 50 years.
abundance_data <- data.frame(time = seq(1:50),
abundance = rnorm(50,mean = 20))
#Activate python environment (only necessary
#on first opening of R session).
## Not run:
ewsnet_init(envname = "EWSNET_env")
## End(Not run)
#Generate EWSNet predictions.
## Not run:
pred <- ewsnet_predict(
abundance_data$abundance,
scaling = TRUE,
ensemble = 15,
envname = "EWSNET_env")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.