Skip to main content

Azure Machine Learning Model Monitoring SDK V2

Project description

Azure Machine Learning Model Monitoring SDK

The azure-ai-mlmonitoring package provides an SDK to enable Model Data Collector (MDC) for custom logging allows customers to collect data at arbitrary points in their data pre-processing pipeline. Customers can leverage SDK in score.py to log data to desired sink before, during, and after any data transformations.

Start by importing the azure-ai-mlmonitoring package in score.py

from azure.ai.mlmonitoring import Collector

def init():
  global inputs_collector, predictions_collector

  # instantiate collectors with appropriate names
  inputs_collector = Collector(name='inputs')                    
  predictions_collector = Collector(name='predictions')

def run(data): 
  input_df = pd.DataFrame(data)  

  # collect input data, store correlation_context
  correlation_context = inputs_collector.collect(data=input_df) 

  # perform scoring
  predictions = model.predict(input_df) 

  # collect predictions data, pass in correlation_context so inputs and predictions data can be correlated later
  predictions_collector.collect(data=predictions, correlation_context=correlation_context)

Create deployment with custom logging enabled and azure-ai-mlmonitoring package.

#source ../configs/model-data-collector/data-storage-basic-OnlineDeployment.YAML
$schema: http://azureml/sdk-2-0/OnlineDeployment.json

endpoint_name: my_endpoint #unchanged
name: blue #unchanged
model: azureml:my-model-m1:1 #azureml:models/<name>:<version> #unchanged
environment: azureml:env-m1:1 #unchanged
data_collector:
  enabled:
      custom: true

Change Log

v0.1.0a1 (2023.1.4)

New Features

  • Support model data collection for pandas Dataframe.

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_mlmonitoring-0.1.0a1-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file azure_ai_mlmonitoring-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for azure_ai_mlmonitoring-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 7185227b2c1f274fc7cafe0e759dc90aaee2d48a14be5c7a9b4bdc47e38a3645
MD5 32a6071c305215a998af769ceecf3806
BLAKE2b-256 26b2c1a66f6a1ff1ba646cb56aa12ec89e087cc3d7f4874fbcd7cbdc846f595a

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