How to train and deploy ml models in azure ml designer, just using components?

74 Views Asked by At

i created a training pipeline in azure ml designer. Now, i need to deploy this model by adding components for registering and deployment. I guess i can use 'execute python script' component to do this. However i can not figure out how can I connect the 'trained best model', which is the output of the 'tune model hyperparameters' component, with 'execute python script' component. So, any idea of how to achieve this task ? I would appreciate your help.

Here is my pipeline :

training pipeline

1

There are 1 best solutions below

4
Ram On

In Azure ML Designer, you can use the ‘Execute Python Script’ component to register and deploy your trained model. To connect the ‘trained best model’ output from the ‘tune model hyperparameters’ component with the ‘execute python script’ component, you can use the ‘trained best model’ output as an input to the ‘execute python script’ component. Then, in the Python script, you can access the input data using the get_input_datasets function.

Here is an example of how you can access the input data in the Python script:

def azureml_main(dataframe1, dataframe2):
    # Get the input datasets
    inputs = get_input_datasets()
    # Get the trained best model
    trained_best_model = inputs['trained best model']
    # Your code here

You can then use the trained_best_model variable in your script to register and deploy the model.