Path1.Mod2.c - Explore Workspace Developer Tools - Python SDK Flashcards
The command for installing the Python SDK package (using pip)
pip install azure-ai-ml
The min Python version required to install the Python ML SDK.
The Python ML SDK is already installed under these conditions
Minimum Python 3.7 to install the SDK
When using notebooks in Azure ML Studio and using Python 3.10 or later
MLClient class usage and four required Parameters
Use the MLClient constructor to authenticate and get a connected instance from your environment to your Workspace:
from azure.ai.ml import MLClient from azure.identity import DefaultAzureCredential ml_client = MLClient( DefaultAzureCredential(), subscription_id, resource_group, workspace )
Required Parameters:
- a TokenCredential
instance (generally can use DefaultAzureCredential()
)
- subscription_id
- resource_group
- workspace_name
The purpose of having an MLClient instance connected to your Workspace
It authenticates your Environment, enabling interaction capabilities with your Workspace, and allowing creation and management of workspace assets and resources.
bcou cou fc
The three methods in the MLClient class for managing resources and the one that
- makes a blocking call
- makes an async call
- can be leveraged for Workspace Reuse
-
begin_create_or_update
- Create or update an Azure ML Resource asynchronously -
create_or_update
- Create or update an Azure ML Resource, blocking -
from_config
- Return a workspace object from an existing Azure ML Workspace. Reads the Workspace config from a file, else throws an exception if one can’t be found. This one allows you to save then reuse your Workspace in different Python notebooks
Read MLClient
The DataStore classes for connecting your Workspace to:
- A Blob Datastore
- A Data Lake (two of them)
- File Datastore
- AzureBlobDataStore
- AzureDataLakeGen1Datastore
- AzureDataLakeGen2Datastore
- AzureFileDatastore
Read Classes
co com env cmp ex_na
command constructor for creating a Job as a Command
For a command:
from azure.ai.ml import command job = command( code="./src", command="python train.py", environment="AzureML-sklearn-0.24-ubuntu18.04-py37-cpu@latest", compute="aml-cluster", experiment_name="train-model" ) returned_job = ml_client.create_or_update(job)
Note that environment can be an environment image file specified by name, or an Environment instance.