Export Suite Output to a HTML Report¶
In this guide, we will demonstrate how to export a suite’s output as an HTML report. This enables easily sharing the results easier and also using deepchecks outside of the notebook environment.
Load Data¶
Let’s fetch the iris train and test datasets
[1]:
from deepchecks.datasets.classification import iris
train_dataset, test_dataset = iris.load_data()
Run Suite¶
[2]:
from deepchecks.suites import full_suite
suite = full_suite()
[3]:
suite_result = suite.run(train_dataset=train_dataset, test_dataset=test_dataset)
Save Suite Result to a HTML Report¶
Exporting the suite’s output to an HTML file is possible using the save_as_html
function. This function expects a file-like object, whether it’s a file name or the full path to the destination folder.
[4]:
suite_result.save_as_html('my_suite.html')
or
[5]:
suite_result.save_as_html() # will save the result in output.html
Working with in-memory buffers¶
The suite output can also be written into a file buffers. This can be done by setting the file
argument with a StringIO or BytesIO buffer object.
[7]:
import io
html_out = io.StringIO()
suite_result.save_as_html(file=html_out)
View Suite Output¶
The suite’s output can still be viewed within the notebook
[8]:
suite_result