Skip to content

feat: add current_title and reference_title to RenderOptions#1877

Open
SuryaSunil1326 wants to merge 1 commit into
evidentlyai:mainfrom
SuryaSunil1326:fix/custom-dataset-titles
Open

feat: add current_title and reference_title to RenderOptions#1877
SuryaSunil1326 wants to merge 1 commit into
evidentlyai:mainfrom
SuryaSunil1326:fix/custom-dataset-titles

Conversation

@SuryaSunil1326
Copy link
Copy Markdown

Summary

Closes #820.

Adds current_title (default Current) and reference_title (default Reference) fields to RenderOptions, making the dataset labels in all data-drift visualizations configurable instead of hardcoded.

Changes:

  • RenderOptions in legacy/options/agg_data.py — two new fields with backwards-compatible defaults
  • plot_scatter_for_data_drift in legacy/utils/visualizations.py — accepts current_title parameter
  • ColumnDriftMetric, DataDriftTable, TextDescriptorsDriftMetric renderers — pass current_title through to scatter plots
  • ColumnValuePlot renderer — passes both titles to the raw scatter render method
  • TargetByFeaturesTable renderer — passes both titles to regression/classification figure helpers

Usage

from evidently.legacy.options.agg_data import RenderOptions
from evidently.legacy.options.base import Options
from evidently.legacy.report import Report
from evidently.legacy.metrics import ColumnDriftMetric

report = Report(
    metrics=[ColumnDriftMetric(column_name=col)],
    options=Options(render=RenderOptions(current_title=Production, reference_title=Training)),
)

Test plan

  • Added test_column_drift_metric_custom_titles — runs a ColumnDriftMetric report with custom titles and verifies the dashboard builds without error
  • All existing tests in tests/metrics/data_drift/test_column_drift_metric.py still pass

Adds `current_title` (default "Current") and `reference_title`
(default "Reference") fields to `RenderOptions`, and threads them
through all data-drift renderer methods that previously hardcoded
those strings in scatter plots, distribution charts, and tables.

Closes evidentlyai#820
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support custom names for reference and current

2 participants