Microsoft Developer Network

Comprehensive documentation for Azure services.

Azure Machine Learning: A Comprehensive Guide

Azure Machine Learning is a cloud-based service that you can use to train, deploy, manage, and monitor machine learning models at scale. It provides a fully managed environment, enabling data scientists and developers to build and run ML workloads without the complexity of managing infrastructure.

Key Features and Capabilities

Automated ML (AutoML)

AutoML automates the time-consuming, iterative tasks of model development. It enables you to efficiently build, train, and deploy machine learning models with minimal expertise.

Designer

Azure Machine Learning designer provides a visual, drag-and-drop interface for building and deploying ML models. It's ideal for users who prefer a graphical approach.

Notebooks

Use popular open-source tools like Jupyter notebooks integrated directly within Azure Machine Learning for a flexible and code-first experience.

Getting Started with Azure Machine Learning

To begin using Azure Machine Learning, you'll need an Azure subscription. You can create a free account to explore the service.

  1. Create an Azure Machine Learning Workspace: This is the foundational resource for all your ML activities.
  2. Data Preparation: Connect to your data sources, whether they are in Azure Blob Storage, Azure Data Lake Storage, or on-premises.
  3. Model Training: Choose between AutoML, the designer, or custom code using notebooks to train your models.
  4. Model Deployment: Deploy your trained models as web services (REST APIs) for real-time inference or batch scoring.
  5. Monitoring: Monitor model performance, drift, and usage in production to ensure accuracy and reliability.

Core Components

Example: Training a Simple Model

Here's a conceptual Python snippet demonstrating how you might start training a model:


from azureml.core import Workspace, Experiment, Environment
from azureml.core.compute import ComputeTarget
from azureml.train.sklearn import SKLearn

# Load workspace
ws = Workspace.from_config()

# Define compute target
compute_name = "your-cpu-cluster" # Replace with your compute cluster name
compute_target = ComputeTarget(workspace=ws, name=compute_name)

# Define environment
env = Environment.from_conda_specification(name='myenv', file_path='environment.yml')

# Define your training script and parameters
script_params = {
    '--input_data': ws.get_default_datastore().url + '/path/to/your/data',
    '--output_dir': './outputs'
}

# Create an Experiment
experiment = Experiment(workspace=ws, name='my-sklearn-experiment')

# Create a training job
est = SKLearn(source_directory='.',
              entry_script='train.py',
              script_params=script_params,
              compute_target=compute_target,
              environment_definition=env,
              framework_version='0.20', # Specify your scikit-learn version
              use_gpu=False)

# Submit the training job
run = est.submit(experiment_name='my-sklearn-experiment')

run.wait_for_completion(show_output=True)
            

For a detailed walkthrough, refer to the official Azure Machine Learning documentation.

Best Practices