alkaline-ml / pmdarima

A statistical library designed to fill the void in Python's time series analysis capabilities, including the equivalent of R's auto.arima function.
https://www.alkaline-ml.com/pmdarima
MIT License
1.57k stars 231 forks source link

Batch functionality #528

Open Jostarndt opened 1 year ago

Jostarndt commented 1 year ago

Is your feature request related to a problem? Please describe.

I would like to call the ARIMA on batches of data, i.e. the data has the shape [batchsize, timesteps], and therefore generate output that has the shape [batchsize, output_size].

Describe the solution you'd like

The auto_arima.predict() function would be cooler if it would take also batched inputs.

Describe alternatives you've considered

Currently I am doing it with a very ugly for-loop:

output_list
for i in range(batchsize):
        model = pm.auto_arima(data[i,:])
        output = model.predict(output_size) 
        output_list.append(output)
output = np.array(output)

However this is not very pythonic and quite slow - maybe I have only missed a batch functionality?

Additional Context

I hope i havend missed that this feature already exists. Thanks alot! :)