'Speed up model predictions when using cron job
I have a set of XGBoost models that needs to run on a minutely interval using predict().
When I set this up to run with a cron job (using the cronR package), the predictions run very slow compared to running it manually from my RStudio environment.
My intuition is that the manual run benefits from running in the live environment with the models already loaded into memory, while the cron job lives in a separate environment and ends up doing all the heavy work each time it runs.
Is there a way to make the cron job work with the environment pre loaded into memory (if this is correct) or any other workaround to speed the predictions up?
EDIT: Updated question to better reflect the nature of the problem.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
