How would I create a machine learning pipeline with AutoML component using Azure Machine Learning Python SDK v2? I see that there is a way to pass in a custom user script as a component in this official guide , but I want to pass in Microsoft AutoML as a component instead.
I tried doing something like below:
...
train_component = automl.regression(
compute=compute_target,
experiment_name=args.experiment_name,
training_data=Input(type="uri_folder"),
validation_data=Input(type="uri_folder"),
target_column_name=args.target,
primary_metric="accuracy",
)
...
@dsl.pipeline(
compute=args.compute_name,
description="AutoML pipeline",
)
def automl_pipeline(
pipeline_job_data_input,
pipeline_job_test_size,
):
data_prep_job = data_prep_component(
data=pipeline_job_data_input,
test_size=pipeline_job_test_size,
)
train_job = train_component(
training_data=data_prep_job.outputs.train_data,
validation_data=data_prep_job.outputs.test_data,
)
return {
"pipeline_job_train_data": data_prep_job.outputs.train_data,
"pipeline_job_test_data": data_prep_job.outputs.test_data,
"pipeline_job_model": train_job.outputs.model,
}
pipeline = automl_pipeline(
pipeline_job_data_input=data.name,
pipeline_job_test_size=0.2,
)
pipeline_job = ml_client.jobs.create_or_update(
pipeline,
experiment_name="test_pipeline",
)
But I am getting TypeError: 'RegressionJob' object is not callable
error. Is this not implemented yet?
I have tried to reproduce the steps and it worked for me. Follow the below steps and instructions:
We need to use AutoMLStep
object when we need to use AutoML as the component for the pipeline.
There are few steps to be followed to assign the AutoML as the component.
**AutoMLStep**
is having the sub class called PipelineStep
There are few steps to be followed.
EDIT 2:
Document Credits: Larry Franks and Team
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.