Getting Started with Azure AI Machine Learning
Azure AI Machine Learning is a unified platform that accelerates the end‑to‑end machine learning lifecycle. This guide walks you through setting up your first workspace, creating a simple model, and deploying it as a managed endpoint.
1. Create an Azure ML Workspace
Use the Azure portal or Azure CLI to provision a workspace.
az ml workspace create \
--name my-ml-workspace \
--resource-group my-resource-group \
--location eastus
2. Set Up a Compute Instance
A compute instance provides an interactive environment for development.
az ml compute create \
--name my-compute \
--type ComputeInstance \
--size Standard_DS2_v2
3. Build Your First Model
Below is a minimal Python script that trains a scikit‑learn model.
import joblib
from sklearn.datasets import load_iris
from sklearn.ensemble import RandomForestClassifier
data = load_iris()
X, y = data.data, data.target
model = RandomForestClassifier()
model.fit(X, y)
joblib.dump(model, "model.pkl")
4. Register the Model
Upload the trained model to your workspace.
az ml model register \
--name iris-classifier \
--path model.pkl \
--workspace-name my-ml-workspace \
--resource-group my-resource-group
5. Deploy as a Real‑Time Endpoint
Create an inference configuration and deploy the model.
az ml endpoint create \
--name iris-endpoint \
--model iris-classifier:1 \
--compute my-compute \
--workspace-name my-ml-workspace \
--resource-group my-resource-group
Next Steps
- Explore automated ML for hyperparameter optimization.
- Integrate with Azure DevOps for CI/CD pipelines.
- Monitor deployed models using Azure Monitor.
For deeper guidance, visit the Resources page.