Skip to main content

Python package for data logging and monitoring.

Project description

Raymon: analyse data & model health

Build Coverage Code style: black License PyPI

What is Raymon?

Raymon helps Machine Learning teams analyse data, data health and model performance. Using Raymon, users can extract features describing data quality, data novelty, model confidence and prediction performance from model predictions. Then, they can use these features to validate production data and generate reports for data drift, data degradation and model degradation.

We can support any data type. Currently, we offer extractors for structured data and vision data, but you can easily implement your own extractor which means we can any data type and any extractor that you want.

Raymon’s focus is on simplicity, practicality and extendability. We offer a set of extractors that are cheap to compute and simple to understand.

Raymon is open source and can be used standalone but integrates nicely with the Raymon.ai ML Observability hub, for example to make predictions traceable and debuggable.

Quick Links

At a glance

Installation

pip install raymon

Building a model profile

Building a ModelProfile captures all kinds of data characteristics of your models inputs, outputs, actuals and predictions.

profile = ModelProfile(
    name="HousePricesCheap",
    version="3.0.0",
    components=[
        InputComponent(
            name="outlier_score",
            extractor=SequenceSimpleExtractor(
                prep=coltf, extractor=KMeansOutlierScorer()),
        ),
        OutputComponent(name="prediction", extractor=ElementExtractor(element=0)),
        ActualComponent(name="actual", extractor=ElementExtractor(element=0)),
        EvalComponent(name="abs_error", extractor=AbsoluteRegressionError()),
    ] + generate_components(X_train[feature_selector].dtypes, 
                            complass=InputComponent), # Generates a component for every column in the DF
    scores=[
        MeanScore(
            name="MAE",
            inputs=["abs_error"],
            preference="low",
        ),
        MeanScore(
            name="mean_outlier_score",
            inputs=["outlier_score"],
            preference="low",
        ),
    ],
)
profile.build(input=X_val[feature_selector], 
              output=y_pred_val[:, None], 
              actual=y_val[:, None])
profile.view()

image

Validating production data

Profiles can then be used in production code to validate your incoming data and model performance monitoring.

tags = profile.validate_input(request)
output_tags = profile.validate_output(request_pred)
actual_tags = profile.validate_actual(request_actual)
eval_tags = profile.validate_eval(output=request_pred, 
                                  actual=request_actual)
# or all at once:
all_tags = profile.validate_all(input=request, 
                                output=request_pred, 
                                actual=request_actual)

Inspect and contrast model profiles

You can contast different model profiles against each other too. For example, to compare the profile at model train time, with the profile on production data, or to compare subsets of production data.

profile.view_contrast(profile_exp)

interactive-demo

Logging text, data and tags

Moreover, if you want to use the rest of the platform, Raymon makes model predictions traceable and debuggable. Raymon enables you to log text, data and tags from anywhere in your code. You can later use these tags and data objects to debug and improve your systems.

import pandas as pd
import numpy as np
from PIL import Image

import raymon.types as rt
from raymon import Trace, RaymonAPILogger, Tag


logger = RaymonAPILogger(project_id=project_id)
trace = Trace(logger=logger, trace_id=None)

# Logging text messages
trace.info("You can log whatever you want here")

# Tagging traces
trace.tag([
        Tag(name="sdk_version", value="1.4.2", type="label"),
        Tag(name="prediction_time_ms", value="120", type="metric")
    ])

# Logging data
img = Image.open("./data_sample/castinginspection/def_front/cast_def_0_0.jpeg")
df = pd.DataFrame(arr, columns=['a', 'b'])

trace.log(ref="pandas-ref", data=rt.DataFrame(df))
trace.log(ref="image-ref", data=rt.Image(img))

For more information, check out our docs & examples!

Project details


Download files

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

Source Distribution

raymon-0.0.39.linux-x86_64.tar.gz (18.5 MB view details)

Uploaded Source

Built Distribution

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

raymon-0.0.39-py3-none-any.whl (18.5 MB view details)

Uploaded Python 3

File details

Details for the file raymon-0.0.39.linux-x86_64.tar.gz.

File metadata

  • Download URL: raymon-0.0.39.linux-x86_64.tar.gz
  • Upload date:
  • Size: 18.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for raymon-0.0.39.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 07885bbb62a1ff96477165b7f1fb3ff48b15947dfebce7f2964f6939ac7faabe
MD5 4fcdcf3518b77879e1c300faab9c78bc
BLAKE2b-256 22a1d727ad4798a9c5d5bad9e8d09b7e7604617cb779ca939b0605d1cfeeef9e

See more details on using hashes here.

File details

Details for the file raymon-0.0.39-py3-none-any.whl.

File metadata

  • Download URL: raymon-0.0.39-py3-none-any.whl
  • Upload date:
  • Size: 18.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for raymon-0.0.39-py3-none-any.whl
Algorithm Hash digest
SHA256 5c5542f981597ae12aa4cfe1cbdb1ba46ea85fcb248265ecfc9efd6d4c01fbdc
MD5 4e214f4bf85c56d4944799711e8225f8
BLAKE2b-256 9213b57f00ec0c41a34d909b338c2e5419d3899828c2a5994db6aaf359defb12

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