Pavel Bartoš
Pavel Bartoš

Reputation: 51

How to pass PipelineParameter into AutoMLStep in AzureML Python SDK

I am using AzureML SDK pipeline with AutoMLStep. How can I add PipelineParameter into AutoMLStep configuration? I would like to use it for a definition of max_horizon. It should work with

passthru_automl_config=False

but I am getting error

Message: Unsupported value of max_horizon. max_horizon must be integer or 'auto'

max_horizon = PipelineParameter(name='max_horizon', default_value=30)

automl_settings = {
            "iteration_timeout_minutes" : 60
            "grain_column_names": ["COUNTRY_CODE"],
            "time_column_name": "DATE"
        }        

automl_config = AutoMLConfig(task='forecasting',
                             path = "./src",
                             primary_metric=primary_metric,
                             iterations=iterations,
                             max_concurrent_iterations=max_concurrent_iterations,
                             training_data = train_data,
                             label_column_name = label,
                             n_cross_validations=5,
                             compute_target = compute_target,
                             max_horizon= max_horizon,
                             **automl_settings)

trainWithAutomlStep = AutoMLStep(name="experiment_name",
                                 automl_config=automl_config,
                                 passthru_automl_config=False,
                                 outputs=[metrics_data, model_data],
                                 allow_reuse=True)

Upvotes: 3

Views: 479

Answers (2)

Pavel Bartoš
Pavel Bartoš

Reputation: 51

Here is a response from Microsoft:

PipelineParameter is currently not supported for use with AutoMLConfig parameters inside of AutoMLStep.

Then, the only workaround in order to use PipelineParameter with AutoMLConfig would be to use AutoML in a PythonScriptStep, which is a similar usage/approach when you use AutoMLConfig with ParallelRunConfig in pipelines (without using AutoMLStep), like the ‘Many Models’ solution accelerator does.

Upvotes: 1

Stefan Balke
Stefan Balke

Reputation: 193

You are running into type-checking issues here. Type PipelineParameter is not allowed for max_horizon.

As an alternativte: Why don't you strive for a simple python_script_step and use the PipelineParameter as an input to that. In the Python-Step file you then define the AutoML routine. This way, you have it all in your hands...

Upvotes: 1

Related Questions