Skip to main content

Microsoft Azure Machine Learning Client Library for Python

Project description

The azure-ai-ml is a Python SDK package (aka AML SDKv2) for Azure Machine Learning, which allows users to:

  • Submit training jobs

  • Manage data, models, environments

  • Perform managed inferencing (real time and batch)

  • Stitch together multiple tasks and production workflows using Azure ML pipelines

Source code | Package (PyPI) | Product documentation | Samples

This package has been tested with Python 3.7, 3.8, 3.9 and 3.10.

For a more complete set of Azure libraries, see https://aka.ms/azsdk/python/all

The SDK v2 is useful in the following scenarios:

  1. Move from simple to complex concepts incrementally. SDK v2 allows you to:
    • Construct a single command.

    • Add a hyperparameter sweep on top of that command

    • Add the command with various others into a pipeline one after the other.

    This construction is useful, given the iterative nature of machine learning.

  2. Reusable components in pipelines

    Azure ML introduces components for managing and reusing common logic across pipelines. This functionality is available only via CLI v2 and SDK v2.

  3. Managed inferencing

    Azure ML offers endpoints to streamline model deployments for both real-time and batch inference deployments. This functionality is available only via CLI v2 and SDK v2.

Getting started

Prerequisites

Install the package

Install the Azure ML client library for Python with pip:

pip install --pre azure-ai-ml

Authenticate the client

from azure.ai.ml import MLClient
from azure.identity import DefaultAzureCredential

ml_client = MLClient(
    DefaultAzureCredential(), subscription_id, resource_group, workspace
)

Examples

Troubleshooting

General

Azure ML clients raise exceptions defined in Azure Core.

from azure.core.exceptions import HttpResponseError

try:
    ml_client.compute.get("cpu-cluster")
except HttpResponseError as error:
    print("Request failed: {}".format(error.message))

Logging

This library uses the standard logging library for logging. Basic information about HTTP sessions (URLs, headers, etc.) is logged at INFO level.

Detailed DEBUG level logging, including request/response bodies and unredacted headers, can be enabled on a client with the logging_enable argument.

See full SDK logging documentation with examples here <https://docs.microsoft.com/azure/developer/python/azure-sdk-logging>.

Telemetry

The Azure ML Python SDK includes a telemetry feature that collects usage and failure data about the SDK and sends it to Microsoft when you use the SDK. Telemetry data helps the SDK team understand how the SDK is used so it can be improved and the information about failures helps the team resolve problems and fix bugs. The SDK telemetry feature is enabled by default. To opt out of the telemetry feature, set the AZUREML_SDKV2_TELEMETRY_OPTOUT environment variable to 1 or true.

Change Log

Initial prerelease

  • initial prerelease

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

azure_ai_ml-0.1.0b3-py3-none-any.whl (2.3 MB view details)

Uploaded Python 3

File details

Details for the file azure_ai_ml-0.1.0b3-py3-none-any.whl.

File metadata

File hashes

Hashes for azure_ai_ml-0.1.0b3-py3-none-any.whl
Algorithm Hash digest
SHA256 3e22fb8842117667189e76af11124912ff6e31dfae09f6f1916ed31cafd6844b
MD5 324d74f5c8f3c33a481a8093607af4af
BLAKE2b-256 5cf90c632893935b470a6934a1fba11854f5e67c047fed4eacb59dfab852eefc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page