Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to terminate the auto.arima process on timeout #536

Open
pranavbahl2308 opened this issue May 4, 2017 · 1 comment
Open

Unable to terminate the auto.arima process on timeout #536

pranavbahl2308 opened this issue May 4, 2017 · 1 comment

Comments

@pranavbahl2308
Copy link

pranavbahl2308 commented May 4, 2017

I am trying to timeout the auto.arima algorithm if it exceeds certain time limit but it keeps on running until it finishes. Is there any way I can timeout the auto.arima. Following is the code snippet I am executing
`
require(R.utils)
library(forecast)
freq <- 52
forecast_freq <- 13

start.time <- Sys.time()
tryCatch(
    {
        res <- evalWithTimeout({
        profileddf <- ts(data,frequency = freq)
        arima_fit_prof<-auto.arima(profileddf)
        forecastoutput_prof_arima <-forecast(arima_fit_prof,h=forecast_freq,level=c(95))
        forecast_df <- c()
        forecast_df <- cbind.data.frame(forecastoutput_prof_arima$mean[1:13],forecastoutput_prof_arima$lower,
                                        forecastoutput_prof_arima$upper,account_id)
        colnames(forecast_df) <- c("back_Forecast","back_lower_95_pi","back_upper_95_pi","account_id")

        end.time <- Sys.time()

        sink()

        return(list(forecast_df,as.numeric(end.time-start.time,units="secs"),"success"))
        }, timeout=30);
        return(res)
    },
    error = function(err) {
        return(list("",as.numeric(Sys.time()-start.time,units="secs"),str(err)))
    }
)

`

@pranavbahl2308 pranavbahl2308 changed the title Unable to terminate the process on timeout Unable to terminate the auto.arima process on timeout May 4, 2017
@robjhyndman
Copy link
Owner

I've no idea. Perhaps ask on stackoverflow.com. If you find an answer, please share it here. It may require some changes to auto.arima

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants