Coder Social home page Coder Social logo

dgosza / evidently-ai-grafana-prometheus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from evidentlyai/evidently

0.0 0.0 0.0 158.29 MB

Evaluate and monitor ML models from validation to production. Join our Discord: https://discord.com/invite/xZjKRaNp8b

License: Apache License 2.0

JavaScript 0.07% Python 95.50% TypeScript 4.43%

evidently-ai-grafana-prometheus's Introduction

Evidently

An open-source framework to evaluate, test and monitor ML models in production.

Docs | Discord Community | User Newsletter | Blog | Twitter

πŸ“Š What is Evidently?

Evidently is an open-source Python library for data scientists and ML engineers. It helps evaluate, test, and monitor the performance of ML models from validation to production.

Evidently has a modular approach with 3 interfaces on top of the shared metrics functionality.

1. Tests: batch model checks

Tests example

Tests perform structured data and ML model quality checks. They verify a condition and return an explicit pass or fail result.

You can create a custom Test Suite from 50+ individual tests or run a preset (for example, Data Drift or Regression Performance). You can get results as an interactive visual dashboard inside Jupyter notebook or Colab, or export as JSON or Python dictionary.

Tests are best for automated batch model checks. You can integrate them as a pipeline step using tools like Airlfow.

2. Reports: interactive dashboards

Note We added a new Report object starting from v0.1.57.dev0. Reports unite the functionality of Dashboards and JSON profiles with a new, cleaner API. You can still use the old Dashboards API but it will soon be depreciated.

Report example

Reports calculate various data and ML metrics and render rich visualizations. You can create a custom Report or run a preset to evaluate a specific aspect of the model or data performance. For example, a Data Quality or Classification Performance report.

You can get an HTML report (best for exploratory analysis and debugging) or export results as JSON or Python dictionary (best for logging, documention or to integrate with BI tools).

3. Real-time ML monitoring

Note This functionality is in development and subject to API change.

Dashboard example

Evidently has monitors that collect data and model metrics from a deployed ML service. You can use it to build live monitoring dashboards. Evidently configures the monitoring on top of streaming data and emits the metrics in Prometheus format. There are pre-built Grafana dashboards to visualize them.

πŸ‘©β€πŸ’» Installing from PyPI

MAC OS and Linux

Evidently is available as a PyPI package. To install it using pip package manager, run:

$ pip install evidently

If you only want to get results as HTML or JSON files, the installation is now complete. To display the dashboards inside a Jupyter notebook, you need jupyter nbextension. After installing evidently, run the two following commands in the terminal from the evidently directory.

To install jupyter nbextension, run:

$ jupyter nbextension install --sys-prefix --symlink --overwrite --py evidently

To enable it, run:

$ jupyter nbextension enable evidently --py --sys-prefix

That's it! A single run after the installation is enough.

Note: if you use Jupyter Lab, the reports might not display in the notebook. However, you can still save them as HTML files.

Windows

Evidently is available as a PyPI package. To install it using pip package manager, run:

$ pip install evidently

Unfortunately, building reports inside a Jupyter notebook is not yet possible for Windows. The reason is Windows requires administrator privileges to create symlink. In later versions we will address this issue. You can still generate the HTML to view externally.

▢️ Getting started

Note This is a simple Hello World example. You can find a complete Getting Started Tutorial in the docs.

Jupyter Notebook

To start, prepare your data as two pandas DataFrames. The first should include your reference data, the second - current production data.Β The structure of both datasets should be identical. To run some of the evaluations (e.g. Data Drift), you need input features only. In other cases (e.g. Target Drift, Classification Performance), you need Target and/or Prediction.

Option 1: Test Suites

After installing the tool, import Evidently test suite and required presets. We'll use a simple toy dataset:

import pandas as pd

from sklearn import datasets

from evidently.test_suite import TestSuite
from evidently.test_preset import DataStabilityTestPreset
from evidently.test_preset import DataQualityTestPreset

iris_data = datasets.load_iris(as_frame='auto')
iris_frame = iris_data.frame

To run the Data Stability test suite and display the reports in the notebook:

data_stability= TestSuite(tests=[
    DataStabilityTestPreset(),
])
data_stability.run(current_data=iris_frame.iloc[:90], reference_data=iris_frame.iloc[90:], column_mapping=None)
data_stability 

To save the results as an HTML file:

data_stability.save_html("file.html")

You'll need to open it from the destination folder.

To get the output as JSON:

data_stability.json()

Option 2: Reports

After installing the tool, import Evidently report and required presets:

import pandas as pd

from sklearn import datasets

from evidently.report import Report
from evidently.metric_preset import DataDriftPreset

iris_data = datasets.load_iris(as_frame='auto')
iris_frame = iris_data.frame

To generate the Data Drift report, run:

data_drift_report = Report(metrics=[
    DataDriftPreset(),
])

data_drift_report.run(current_data=iris_frame.iloc[:90], reference_data=iris_frame.iloc[90:], column_mapping=None)
data_drift_report

To save the report as HTML:

data_drift_report.save_html("file.html")

You'll need to open it from the destination folder.

To get the output as JSON:

data_drift_report.json()

πŸ’» Contributions

We welcome contributions! Read the Guide to learn more.

πŸ“š Documentation

For more information, refer to a complete Documentation. You can start with this Tutorial for a quick introduction.

πŸ—‚οΈ Examples

Here you can find simple examples on toy datasets to quickly explore what Evidently can do right out of the box.

Report Jupyter notebook Colab notebook Contents
Getting Started Tutorial link link Data Stability and custom test suites, Data Drift and Target Drift reports
Evidently Metric Presets link link Data Drift, Target Drift, Data Quality, Regression, Classification reports
Evidently Metrics link link All individual metrics
Evidently Test Presets link link NoTargetPerformance, Data Stability, Data Quality, Data Drift Regression, Milti-class Classification, Binary Classification, Binary Classification top-K test suites
Evidently Tests link link All individual tests

Integrations

See how to integrate Evidently in your prediction pipelines and use it with other tools.

Title link to tutorial
Real-time ML monitoring with Grafana Evidently + Grafana
Batch ML monitoring with Airflow Evidently + Airflow
Log Evidently metrics in MLflow UI Evidently + MLflow

☎️ User Newsletter

To get updates on new features, integrations and code tutorials, sign up for the Evidently User Newsletter.

βœ… Discord Community

If you want to chat and connect, join our Discord community!

evidently-ai-grafana-prometheus's People

Contributors

0lgaf avatar aadral avatar alex-zenml avatar amirhessam88 avatar ampx-mg avatar antoniscst avatar augustkarlstedt avatar bnriiitb avatar buchmayne avatar burkovae avatar caron14 avatar chris-is avatar elenasamuylova avatar emeli-dral avatar hassiahk avatar inderpreetsingh01 avatar jenoovchi avatar liraim avatar marcellovictorino avatar nataliatarasovanatoshir avatar nathnx avatar obbiondo avatar polaser avatar radionbik avatar sangamswadik avatar sllynn avatar strickvl avatar tapot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.