Evidently Metrics Calculation

Evidently Metrics Calculation

Evidently compares a reference dataset with a current dataset and produces a report. The report can calculate several aspects of model and data behavior in one run.

Select metrics and map columns

The example calculates three useful metrics:

  • drift for the prediction column.
  • dataset drift across the monitored columns.
  • the share of missing values in the current data.

Create a ColumnMapping so Evidently knows which columns are numerical, which are categorical, and which column contains the prediction. A correct mapping is as important as the metric choice because it controls how the distributions are interpreted.

An Evidently report with the selected metrics

report.run(
    reference_data=reference_data,
    current_data=current_data,
    column_mapping=column_mapping,
)

The report evaluates the reference and current batch together. Save the HTML report when you need a human-readable investigation artifact, and extract the numeric values when you need to store time-series data for Grafana.

Metric values calculated from a monitoring batch

Persist the result

The example inserts prediction drift, the number of drifted columns, and the share of missing values into PostgreSQL. A monitoring job can then repeat the calculation for each daily batch and append one timestamped row.

Monitoring metrics ready for a Grafana view

Optional analytics

Optional analytics are off unless you allow them. Your choice does not affect access to DataTalks.Club, Slack, events, or courses.

Current choice: not chosen.

Privacy Policy

If you allow analytics, self-hosted Umami counts anonymous public pageviews without analytics cookies. Private account and learning pages are excluded. Read the Privacy Policy for the complete data boundary.