Skip to content

Commit

Permalink
Updated version
Browse files Browse the repository at this point in the history
Updated metric & metric preset examples

Updated Titles in DataDriftTable & DatasetDriftMetric
  • Loading branch information
emeli-dral committed Oct 26, 2022
1 parent f6811df commit b46fd21
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
17 changes: 16 additions & 1 deletion examples/sample_notebooks/evidently_metric_presets.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"from evidently.metric_preset import DataQualityPreset\n",
"from evidently.metric_preset import RegressionPreset\n",
"from evidently.metric_preset import ClassificationPreset\n",
"from evidently.metric_preset import NumTargetDrift, CatTargetDrift"
"from evidently.metric_preset import NumTargetDrift, CatTargetDrift, TargetDriftPreset"
]
},
{
Expand Down Expand Up @@ -273,6 +273,21 @@
"cat_target_drift_report.run(reference_data=iris_ref, current_data=iris_cur)\n",
"cat_target_drift_report"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#to be fixed in the next release\n",
"target_drift_report = Report(metrics=[\n",
" TargetDriftPreset(),\n",
"])\n",
"\n",
"target_drift_report.run(reference_data=iris_ref, current_data=iris_cur)\n",
"target_drift_report"
]
}
],
"metadata": {
Expand Down
5 changes: 2 additions & 3 deletions examples/sample_notebooks/evidently_metrics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"from evidently.metrics import DataDriftTable\n",
"from evidently.metrics import DatasetDriftMetric\n",
"from evidently.metrics import ColumnDistributionMetric\n",
"from evidently.metrics import ColumnValuePlot\n",
"from evidently.metrics import ColumnQuantileMetric\n",
"from evidently.metrics import ColumnCorrelationsMetric\n",
"from evidently.metrics import ColumnValueListMetric\n",
Expand Down Expand Up @@ -200,7 +201,7 @@
"#column-level metrics\n",
"data_drift_column_report = Report(metrics=[\n",
" ColumnDriftMetric('age'),\n",
" ColumnDriftMetric('education'), \n",
" ColumnValuePlot('age'), \n",
"])\n",
"\n",
"data_drift_column_report.run(reference_data=adult_ref, current_data=adult_cur)\n",
Expand All @@ -221,7 +222,6 @@
"outputs": [],
"source": [
"#dataset-level metrics\n",
"\n",
"data_quality_dataset_report = Report(metrics=[\n",
" DatasetCorrelationsMetric(),\n",
" \n",
Expand Down Expand Up @@ -405,7 +405,6 @@
"source": [
"#options\n",
"stat_test_option = DataDriftOptions(all_features_stattest='psi')\n",
"color_option = ColorOptions\n",
"\n",
"data_drift_column_report = Report(metrics=[\n",
" ColumnDriftMetric('age'),\n",
Expand Down
2 changes: 1 addition & 1 deletion src/evidently/_version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# coding: utf-8

version_info = (0, 1, 59, "dev0")
version_info = (0, 1, 59, "dev2")
__version__ = ".".join(map(str, version_info))
2 changes: 1 addition & 1 deletion src/evidently/metrics/data_drift/data_drift_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def render_html(self, obj: DataDriftTable) -> List[BaseWidgetInfo]:
drift_percents = round(results.share_of_drifted_columns * 100, 3)

return [
header_text(label="Data Drift Report"),
header_text(label="Data Drift Summary"),
rich_table_data(
title=f"Drift is detected for {drift_percents}% of columns "
f"({results.number_of_drifted_columns} out of {results.number_of_columns}).",
Expand Down
4 changes: 2 additions & 2 deletions src/evidently/metrics/data_drift/dataset_drift_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ def render_html(self, obj: DatasetDriftMetric) -> List[BaseWidgetInfo]:
counter(
counters=[
CounterData(
f"Dataset drift detection threshold is {result.threshold}",
f"Dataset Drift is {drift_detected}",
f"Dataset Drift is {drift_detected}. Dataset drift detection threshold is {result.threshold}",
"Dataset Drift",
)
],
title="",
Expand Down

0 comments on commit b46fd21

Please sign in to comment.