-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(comparison): feature description
- Loading branch information
Showing
2 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
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,50 @@ | ||
================== | ||
Dataset Comparison | ||
================== | ||
|
||
*This feature was introduced in pandas-profiling 3.4.* | ||
|
||
``pandas-profiling`` can be used to compare multiple version of the same dataset. | ||
This is useful when comparing data from multiple time periods, such as two years. | ||
Another common scenario is to view the dataset profile for training, validation and test sets in machine learning. | ||
|
||
The following syntax can be used to compare two datasets: | ||
|
||
.. code-block:: python | ||
from pandas_profiling import ProfileReport | ||
train_df = pd.read_csv("train.csv") | ||
train_report = ProfileReport(train_df, title="Train") | ||
test_df = pd.read_csv("test.csv") | ||
test_report = ProfileReport(test_df, title="Test") | ||
comparison_report = train_report.compare(test_report) | ||
comparison_report.to_file("comparison.html") | ||
The comparison report uses the ``title`` attribute out of ``Settings`` as a label throughout. | ||
The colors are configured in ``settings.html.style.primary_colors``. | ||
The numeric precision parameter ``settings.report.precision`` can be played with to obtain some additional space in reports. | ||
|
||
|
||
In order to compare more than two reports, the following syntax can be used: | ||
|
||
.. code-block:: python | ||
from pandas_profiling import ProfileReport, compare | ||
comparison_report = compare([train_report, validation_report, test_report]) | ||
# Obtain merged statistics | ||
statistics = comparison_report.get_description() | ||
# Save report to file | ||
comparison_report.to_file("comparison.html") | ||
Note that generating reports for three or more datasets is not (yet) fully supported. | ||
It is possible to obtain the statistics - the report may have formatting issues. | ||
|
||
.. pull-quote:: | ||
|
||
⌛ Interested in uncovering more temporal patterns? Check out `popmon <https://github.com/ing-bank/popmon>`_. |