.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "user-guide/general/exporting_results/examples/plot_export_suite_results_as_html.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_user-guide_general_exporting_results_examples_plot_export_suite_results_as_html.py: 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. **Structure:** * `Save Suite Result to an HTML Report <#save-suite-result-to-an-html-report>`__ .. GENERATED FROM PYTHON SOURCE LINES 16-19 Load Data --------- Let's fetch the iris train and test datasets .. GENERATED FROM PYTHON SOURCE LINES 19-24 .. code-block:: default from deepchecks.tabular.datasets.classification import iris train_dataset, test_dataset = iris.load_data() .. GENERATED FROM PYTHON SOURCE LINES 25-27 Run Suite --------- .. GENERATED FROM PYTHON SOURCE LINES 27-32 .. code-block:: default from deepchecks.tabular.suites import full_suite suite = full_suite() .. GENERATED FROM PYTHON SOURCE LINES 33-36 .. code-block:: default suite_result = suite.run(train_dataset=train_dataset, test_dataset=test_dataset) .. rst-class:: sphx-glr-script-out .. code-block:: none Full Suite: | | 0/36 [Time: 00:00] Full Suite: |##################### | 21/36 [Time: 00:00, Check=Feature Label Correlation Change] .. GENERATED FROM PYTHON SOURCE LINES 37-42 Save Suite Result to an 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. .. GENERATED FROM PYTHON SOURCE LINES 42-48 .. code-block:: default suite_result.save_as_html('my_suite.html') # or suite_result.save_as_html() # will save the result in output.html .. rst-class:: sphx-glr-script-out .. code-block:: none 'output.html' .. GENERATED FROM PYTHON SOURCE LINES 49-56 .. code-block:: default # Removing outputs created. this cell should be hidden in nbpshinx using "nbsphinx: hidden" in the metadata import os os.remove('output.html') os.remove('my_suite.html') .. GENERATED FROM PYTHON SOURCE LINES 57-61 **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. .. GENERATED FROM PYTHON SOURCE LINES 61-67 .. code-block:: default import io html_out = io.StringIO() suite_result.save_as_html(file=html_out) .. GENERATED FROM PYTHON SOURCE LINES 68-71 View Suite Output ----------------- The suite's output can still be viewed within the notebook .. GENERATED FROM PYTHON SOURCE LINES 71-73 .. code-block:: default suite_result .. raw:: html
Full Suite


.. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 4.968 seconds) .. _sphx_glr_download_user-guide_general_exporting_results_examples_plot_export_suite_results_as_html.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_export_suite_results_as_html.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_export_suite_results_as_html.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_