-
Notifications
You must be signed in to change notification settings - Fork 607
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs on plot aggregation (WIP) (#602)
Update docs
- Loading branch information
1 parent
8a45dbd
commit feab36f
Showing
5 changed files
with
86 additions
and
2 deletions.
There are no files selected for viewing
Binary file added
BIN
+51.5 KB
...book/.gitbook/assets/reports/metric_regression_predvsactual_scatter_agg-min.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+112 KB
.../.gitbook/assets/reports/metric_regression_predvsactual_scatter_non_agg-min.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
description: How to change data aggregation in plots. | ||
--- | ||
|
||
**Pre-requisites**: | ||
* You know how to generate Reports with default parameters. | ||
* You know how to pass custom parameters for Reports or Metrics. | ||
|
||
# Code example | ||
|
||
You can refer to an example How-to-notebook: | ||
|
||
{% embed url="https://github.com/evidentlyai/evidently/blob/main/examples/how_to_questions/how_to_use_aggregated_data_option.ipynb" %} | ||
|
||
# Default | ||
|
||
Starting from version 0.3.2, all visualizations in Reports are aggregated by default. This helps reduce the size of the resulting HTML. | ||
|
||
For example, you can create a custom Report: | ||
|
||
```python | ||
report = Report(metrics=[ | ||
RegressionPredictedVsActualScatter(), | ||
RegressionPredictedVsActualPlot() | ||
]) | ||
report.run(reference_data=housing_ref, current_data=housing_cur) | ||
report | ||
``` | ||
|
||
Here is how the Scatter Plot in this Report will look: | ||
|
||
![RegressionPredictedVsActualScatter()](../.gitbook/assets/reports/metric_regression_predvsactual_scatter_agg-min.png) | ||
|
||
{% hint style="info" %} | ||
**This does not affect Test Suites.** All visualizations in Test Suites are already aggregated. | ||
{% endhint %} | ||
|
||
# Non-aggregated plots for Reports | ||
|
||
If you want to see non-aggregated plots, you can set the `raw_data` parameter as `True` in the render options. | ||
|
||
You can set it on the Report level: | ||
|
||
```python | ||
report = Report( | ||
metrics=[ | ||
RegressionPredictedVsActualScatter(), | ||
RegressionPredictedVsActualPlot() | ||
], | ||
options={"render": {"raw_data": True}} | ||
) | ||
report.run(reference_data=housing_ref, current_data=housing_cur) | ||
report | ||
``` | ||
|
||
All plots in the Report will be non-aggregated. Here is how the Scatter Plot in this Report will look: | ||
|
||
![RegressionPredictedVsActualScatter()](../.gitbook/assets/reports/metric_regression_predvsactual_scatter_non_agg-min.png) | ||
|
||
{% hint style="info" %} | ||
**Consider the data size.** We recommend setting this option for smaller datasets or when you apply sampling. With non-aggregated plots, the HTML will contain all the data on individual data points. They may take significant time to load and be large in size. | ||
{% endhint %} | ||
|
||
# Non-aggregated plots for Metrics | ||
|
||
If you want to generate non-aggregated plots only for some visualizations, you can pass the option to the chosen Metrics: | ||
|
||
```python | ||
report = Report( | ||
metrics=[ | ||
RegressionPredictedVsActualScatter(options={"render": {"raw_data": True}}), | ||
RegressionPredictedVsActualPlot() | ||
], | ||
) | ||
report.run(reference_data=housing_ref, current_data=housing_cur) | ||
report | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters