Skip to main content

A helper library to interact with Arize AI APIs

Project description



Arize AI PyPI version CI

Overview

A helper library to interact with Arize AI APIs


Quickstart

Instrument your model to log predictions and latent truth events. The logged events allow the Arize platform to generate visualizations of features, model output and prediction evaluation metrics. Additionally the platform will provide data quality monitoring and data distribution alerts, for your production models.

Start logging with the following steps.

1. Create your account

Sign up for a free account by reaching out to contacts@arize.com.



2. Get your service key

When you create an account, we generate a service api key. You will need this API Key and account id for logging authentication.

3. Instrument your code

Python Client

If you are using our python client, add a few lines to your code to log predictions and truths. Logs are sent to Arize asynchrously.

Install Library

Install our library in an environment using Python 3.

$ pip3 install arize

Or clone the repo:

$ git clone https://github.com/Arize-ai/client_python.git
$ python setup.py install

Initialize Python Client

Initialize arize at the start of your sevice using your previously created Account ID and API Key

NOTE: We suggest adding the API KEY as secrets or an environment variable.

from arize.api import AsyncClient

API_KEY = os.environ.get('ARIZE_API_KEY') #If passing api_key via env vars

arize = AsyncClient(account_id=1234, api_key=API_KEY, uri='https://dev.arize.com/v1/log')

Collect your model input features and labels you'd like to track

You can track all input features used to at prediction time by logging it via a key:value dictionary.

labels = {
    'state': 'ca',
    'city': 'berkeley',
    'lat': 37.8717,
    'lng': -122.2579,
    'pos_approved': True,
    'item_count': 10,
    'merchant_type': 'educational',
    'charge_amount': '20.11',
    }

Log Predictions

arize.log(
    model_id='sample-model-1',
    model_version='v1.23.64', ## Optional
    prediction_id='plED4eERDCasd9797ca34',
    prediction_value=True,
    labels=labels,
    )

We automatically discover new models logged over time based on the model ID sent on each prediction.

Log Truths

arize.log(
    model_id='sample-model-1',
    prediction_id='plED4eERDCasd9797ca34',
    truth_value=True,
    )

Once a truth for a prediction is determined, you can log those to Arize and evaluate your metrics over time. What links the truch to the original prediction is the prediction_id for a model_id

4. Log In for Analytics

That's it! Once your service is deployed and predictions are logged you'll be able to log into your Arize account and dive into your data. Slicing it by feature labels, models, time, etc.

Analytics Dashboard




Other languages

If you are using a different language, you'll be able to post an HTTP request to our Arize edge-servers to log your events.

HTTP post request to Arize

curl -X POST -H "Authorization: API_KEY" "https://dev.arize.com/v1/log" -d'{"account_id": 0, "model_id": "test_model_1", "prediction_id":"test100", "prediction":{"model_version": "v1.23.64", "labels":{"state":{"string_label": "CO"}, "item_count":{"int_label": 10}, "charge_amt":{"label_float": 12.34}, "physical_card":{"string_label": true}}, "prediction_value": {"binary_value": false}}}'

Contributing

TBD

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

arize-0.0.7.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arize-0.0.7-py2.py3-none-any.whl (9.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file arize-0.0.7.tar.gz.

File metadata

  • Download URL: arize-0.0.7.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

File hashes

Hashes for arize-0.0.7.tar.gz
Algorithm Hash digest
SHA256 3f8f54c258375becfab9d296d5904cb4c7e0b021a34ee493d822237015ce3d66
MD5 d56013c30cd976bf6558df0ad62f7db0
BLAKE2b-256 7680fc09283eec75ee2223d4bd88a4d0bfbd837f115b1e5a575ada94ae388252

See more details on using hashes here.

File details

Details for the file arize-0.0.7-py2.py3-none-any.whl.

File metadata

  • Download URL: arize-0.0.7-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

File hashes

Hashes for arize-0.0.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fd6abe169ca11033b267f0bd1e87609ff77c87bdb53a931aaf5c414a810a0c0a
MD5 17a020c75e3d8e474c8870b27d2afa1b
BLAKE2b-256 e7dd5f4cbcd7b51e0b111e5ad178019d18e2aa882980071869c7a7da3799c264

See more details on using hashes here.

Supported by

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