💡 What is NannyML Cloud SDK?
NannyML Cloud is a web application that allows you to estimate post-deployment model performance (without access to targets), detect data drift, and intelligently link data drift alerts back to changes in model performance. Built for data scientists, NannyML Cloud has an easy-to-use interface, interactive visualizations, is completely model-agnostic and currently supports all tabular use cases, classification and regression.
NannyML Cloud SDK is a python package that enables programatic interaction with NannyML Cloud. It allows you to automate all aspects of NannyML Cloud, including:
- Creating a model for monitoring
- Logging inferences for analysis
- Triggering model analysis
🚀 Getting started
Install NannyML Cloud SDK
The nannyml-cloud-sdk package is available on PyPi and can be installed using your favorite package manager.
Compatibility
You can check which SDK version support which NannyML Cloud versions over on the dedicated cloud documentation page.
Authentication
To use the NannyML Cloud SDK you need to provide the URL of your NannyML Cloud instance and an API token to authenticate. You can obtain an API token on the settings page of your NannyML Cloud instance.
In code:
import nannyml_cloud_sdk as nml_sdk
nml_sdk.url = "https://beta.app.nannyml.com"
nml_sdk.api_token = r"api token goes here"
Using environment variables:
import nannyml_cloud_sdk as nml_sdk
import os
nml_sdk.url = os.environ['NML_SDK_URL']
nml_sdk.api_token = os.environ['NML_SDK_API_TOKEN']
Quick start
This snippet provides an example of how you can create a model in NannyML Cloud to start monitoring it.
import nannyml_cloud_sdk as nml_sdk
import os
import pandas as pd
nml_sdk.url = os.environ['NML_SDK_URL']
nml_sdk.api_token = os.environ['NML_SDK_API_TOKEN']
# Load a NannyML binary classification dataset to use as example
reference_data = pd.read_csv('https://github.com/NannyML/nannyml/raw/main/nannyml/datasets/data/synthetic_sample_reference.csv')
analysis_data = pd.read_csv('https://github.com/NannyML/nannyml/raw/main/nannyml/datasets/data/synthetic_sample_analysis.csv')
target_data = pd.read_csv('https://github.com/NannyML/nannyml/raw/main/nannyml/datasets/data/synthetic_sample_analysis_gt.csv')
print(reference_data.head())
# Inspect schema from dataset and apply overrides
schema = nml_sdk.monitoring.Schema.from_df(
'BINARY_CLASSIFICATION',
reference_data,
target_column_name='work_home_actual',
ignore_column_names=('period'),
)
# Create model
model = nml_sdk.monitoring.Model.create(
name='Example model',
schema=schema,
chunk_period='MONTHLY',
reference_data=reference_data,
analysis_data=analysis_data,
target_data=target_data,
key_performance_metric='F1',
)
print("Model", model['id'], "created at", model['createdAt'])
Once a model has been set up in NannyML Cloud, you could use the snippet below to add more data and ensure continuous monitoring of your model.
import nannyml_cloud_sdk as nml_sdk
import os
import pandas as pd
nml_sdk.url = os.environ['NML_SDK_URL']
nml_sdk.api_token = os.environ['NML_SDK_API_TOKEN']
# Find model in NannyML Cloud by name
model, = nml_sdk.monitoring.Model.list(name='Example model')
# Add new inferences to NannyML Cloud
new_inferences = pd.DataFrame()
nml_sdk.monitoring.Model.add_analysis_data(model['id'], new_inferences)
# If you have delayed access to ground truth, you can add them to NannyML Cloud
# later. This will match analysis & target datasets using an identifier column.
delayed_ground_truth = pd.DataFrame()
nml_sdk.monitoring.Model.add_analysis_target_data(model['id'], delayed_ground_truth)
# Trigger analysis of the new data
nml_sdk.monitoring.Run.trigger(model['id'])
Metadata
Release files for nannyml-cloud-sdk 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nannyml_cloud_sdk-0.1.8.tar.gz | 148.3 kB | Without provenance | Details for nannyml_cloud_sdk-0.1.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nannyml_cloud_sdk-0.1.8-py3-none-any.whl | Python 3 | none | any | Details for nannyml_cloud_sdk-0.1.8-py3-none-any.whl |
Total release size: 185.4 kB
Release files / nannyml_cloud_sdk-0.1.8.tar.gz
| Download URL | nannyml_cloud_sdk-0.1.8.tar.gz |
|---|---|
| Size | 148.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7faf73b36b8fc77797b2e20f7e4814efb661d691c95222b2350d9b49368f2720
|
|
BLAKE2b-256 checksum How to use checksums |
5453159d3d131aca7e3e6dd1cdd53e6c4958ac2072fb7d1b4d58a7f7dd579ea6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.6.3
|
Release files / nannyml_cloud_sdk-0.1.8-py3-none-any.whl
| Download URL | nannyml_cloud_sdk-0.1.8-py3-none-any.whl |
|---|---|
| Size | 37.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a306d80c76cbb5e7c00bffc80a2116ddeef1993c43f45c11541e5ca5540f6b7f
|
|
BLAKE2b-256 checksum How to use checksums |
7b4b72d869a068ee1c3cbfcb12f97d0e8aa605b6bde42311deead6102a305b0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.6.3
|
Security for nannyml-cloud-sdk 0.1.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.