Azure Machine Learning Studio Intermediate
Azure Machine Learning Studio is a comprehensive, enterprise-grade platform for building, training, and deploying machine learning models. It provides a visual Designer for no-code ML, AutoML for automated model selection, and full SDK support for code-first workflows.
Creating a Workspace
# Create an Azure ML workspace az ml workspace create \ --name my-ml-workspace \ --resource-group ai-school-rg \ --location eastus
from azure.ai.ml import MLClient from azure.identity import DefaultAzureCredential # Connect to workspace ml_client = MLClient( credential=DefaultAzureCredential(), subscription_id="YOUR_SUBSCRIPTION_ID", resource_group_name="ai-school-rg", workspace_name="my-ml-workspace" )
AutoML
AutoML automatically selects the best algorithm and hyperparameters for your dataset. It supports classification, regression, time series forecasting, computer vision, and NLP tasks.
from azure.ai.ml import automl, Input # Configure AutoML classification job classification_job = automl.classification( compute="gpu-cluster", experiment_name="my-automl-experiment", training_data=Input(type="mltable", path="azureml://datastores/training/paths/data/"), target_column_name="label", primary_metric="accuracy", n_cross_validations=5 ) # Set limits classification_job.set_limits( timeout_minutes=60, max_trials=20, max_concurrent_trials=4 ) # Submit the job returned_job = ml_client.jobs.create_or_update(classification_job) print(f"Job URL: {returned_job.studio_url}")
Designer (Visual ML)
The Designer provides a drag-and-drop interface for building ML pipelines without writing code. It includes pre-built modules for data transformation, feature engineering, model training, and evaluation.
| Module Category | Examples |
|---|---|
| Data Input/Output | Import Data, Export Data, Enter Data Manually |
| Data Transformation | Select Columns, Clean Missing Data, Normalize Data, Join Data |
| Feature Engineering | Feature Hashing, Extract N-Gram Features, One-Hot Encoding |
| Training | Train Model, Tune Model Hyperparameters, Cross Validate |
| Evaluation | Evaluate Model, Score Model, Permutation Feature Importance |
Managed Compute
Azure ML provides several compute options for different workloads:
from azure.ai.ml.entities import AmlCompute # Create a GPU compute cluster gpu_cluster = AmlCompute( name="gpu-cluster", type="amlcompute", size="Standard_NC6s_v3", # V100 GPU min_instances=0, max_instances=4, idle_time_before_scale_down=120 # Scale down after 2 min idle ) ml_client.compute.begin_create_or_update(gpu_cluster)
Model Deployment
from azure.ai.ml.entities import ManagedOnlineEndpoint, ManagedOnlineDeployment # Create an online endpoint endpoint = ManagedOnlineEndpoint( name="my-endpoint", auth_mode="key" ) ml_client.online_endpoints.begin_create_or_update(endpoint) # Deploy the model deployment = ManagedOnlineDeployment( name="blue", endpoint_name="my-endpoint", model="azureml:my-model:1", instance_type="Standard_DS3_v2", instance_count=1 ) ml_client.online_deployments.begin_create_or_update(deployment)
min_instances=0 on clusters to automatically scale down and avoid idle costs.
ML Studio Mastered!
You can now build and deploy custom ML models with Azure. Next, explore Azure Cognitive Services for pre-built AI capabilities.
Next: Cognitive Services →
Lilly Tech Systems