[Python] How can I let `auto_arima` automatically select the optimal seasonal period (`m`)?

Discussão em 'Python' iniciado por Stack, Setembro 5, 2025.

  1. Stack

    Stack Membro Participativo

    I’m trying to build a generic auto‑ARIMA pipeline that works on many different time‑series datasets.
    The main difficulty is getting the algorithm to automatically detect the optimal seasonal period (m).
    Other parameters (e.g., whether the series is seasonal) also need to be inferred correctly.

    Below is the code I’m currently using:

    from pmdarima import auto_arima

    # Train model automatically
    model = auto_arima(
    data,
    seasonal=True, # let the algorithm decide if seasonality exists
    stepwise=True, # speed up the search
    suppress_warnings=True,
    m=20, # <-- I would like this to be chosen automatically
    # seasonal_test="ch", # (optional) test for seasonality
    )


    Is there a built‑in option in pmdarima.auto_arima to let it infer the optimal m automatically? If not, what is the recommended approach for determining m programmatically (e.g., using autocorrelation, spectral analysis, etc.) before calling auto_arima?

    Tnx

    Continue reading...

Compartilhe esta Página