You can manage your machine learning models with the Azure Machine Learning extension for the CLI (v2). When you execute code as an Azure Machine Learning job, you can easily set up automated model training.
The first step to operationalize a machine learning model is to run it as an Azure Machine Learning job. You can run individual scripts as command jobs, or groups of scripts as a pipeline job.
For both command and pipeline jobs, you’ll need to create a YAML file, which details:
$schema: https://azuremlschemas.azureedge.net/latest/commandJob.schema.json
code: src
command: >-
python main.py
--diabetes-csv $
inputs:
diabetes:
path: azureml:diabetes-data:1
mode: ro_mount
environment: azureml:basic-env-scikit@latest
compute: azureml:aml-instance
experiment_name: diabetes-data-example
description: Train a classification model on diabetes data using a registered dataset as input.
The code refers to the local folder, which stores the scripts you want to run. The command key specifies that the main.py script in the src folder should be executed, using the value of inputs.diabetes for the diabetes-csv parameter.
Version 1 of the registered data asset diabetes-data in the Azure Machine Learning workspace is mounted to the compute to be used as input for the script.
The compute instance aml-instance will be used to run the scripts.
The latest version of the registered custom basic-env-scikit environment will be installed on the compute instance before running the script.