MachineLearningNotebooks icon indicating copy to clipboard operation
MachineLearningNotebooks copied to clipboard

AutoArima fails with non-stationary data error

Open EricWrightAtWork opened this issue 6 years ago • 1 comments

The AutoArima iteration in AutoML for forecasting tasks can fail with the error:

ValueError: Could not successfully fit ARIMA to input data. It is likely your data is non-stationary. Please induce stationarity or try a different range of model order params. If your data is seasonal, check the period (m) of the data.

This is due to an issue in the pmdarima package with the latest statsmodels version (0.11.0).

Workaround You can work-around this issue by forcing AutoML to revert to previous statsmodels versions. This can be specified using a RunConfiguration which pins a package to specified versions while building the AutoML Docker image.

from azureml.core.runconfig import RunConfiguration
from azureml.core.conda_dependencies import CondaDependencies
import pkg_resources 

# create a new RunConfig object
conda_run_config = RunConfiguration(framework="python") 

# Set compute target to AmlCompute
conda_run_config.target = compute_target
conda_run_config.environment.docker.enabled = True 

cd = CondaDependencies.create(conda_packages=['statsmodels<=0.10.2'])
conda_run_config.environment.python.conda_dependencies = cd

The configuration, conda_run_config is then passed into an AutoMLConfig as follows:

sample_automl_config = AutoMLConfig(
    task='forecasting',
    primary_metric='normalized_mean_absolute_error',
    debug_log='automl_errors.log',
    run_configuration=conda_run_config,                 # As defined above. 
    training_data=train_dataset,
    label_column_name=target_column_name,
    compute_target=compute_target,
    ...                         

Alternatively, installing the latest, stable AzureML SDK into a fresh conda environment on the client computer should also fix this issue.

EricWrightAtWork avatar Feb 18 '20 23:02 EricWrightAtWork

@EricWrightAtWork thanks for your feedback. We will now proceed to close this thread. Thanks.

GiftA-MSFT avatar Mar 10 '20 19:03 GiftA-MSFT