Metadata-Version: 2.1
Name: azure-ai-mlmonitoring
Version: 0.1.0a1
Summary: Azure Machine Learning Model Monitoring SDK V2
Author: Microsoft Corporation
Author-email: azuremlsdk@microsoft.com
License: MIT License
Keywords: AzureMachineLearning,ModelMonitoring
Platform: any
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: MIT License
Description-Content-Type: text/markdown
Requires-Dist: requests (==2.28.1)
Provides-Extra: setup
Requires-Dist: setuptools (>=40.4.3) ; extra == 'setup'
Requires-Dist: pip (~=20.3) ; extra == 'setup'
Requires-Dist: wheel ; extra == 'setup'
Provides-Extra: test
Requires-Dist: pytest-subtests ; extra == 'test'
Requires-Dist: pytest-cov ; extra == 'test'
Requires-Dist: pytest-xdist ; extra == 'test'
Requires-Dist: numpy ; extra == 'test'
Requires-Dist: pandas ; extra == 'test'

# 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](https://pypi.org/project/azure-ai-mlmonitoring/0.1.0a1/) (2023.1.4)

**New Features**

- Support model data collection for pandas Dataframe.
