This document discusses using Sweetviz for exploratory data analysis within the Incorta notebook. It provides code to analyze a single data set, compare two data sets, and display the Sweetviz HTML report within the notebook or in a separate browser tab. The code defines a function to load and format the Sweetviz report for display.
1 of 10
More Related Content
Exploratory Data Analysis with Sweetviz in Incorta
2. The Direct Data Platform?
Exploratory Data
Analysis with Sweetviz
Dylan Wan
Senior Director, Data Science and Machine Learning
3. ? Incorta, Inc. All Rights Reserved Internal Use Only
Using Incorta Notebook
3
4. ? Incorta, Inc. All Rights Reserved Internal Use Only
Using Incorta Notebook - show_html extension
4
def show_html(sweetviz_report):
sweetviz_report.page_layout = 'widescreen'
sweetviz_report.scale = 1.0
sv_html.load_layout_globals_from_config()
sv_html.set_summary_positions(sweetviz_report)
sv_html.generate_html_detail(sweetviz_report)
if sweetviz_report.associations_html_source:
sweetviz_report.associations_html_source = sv_html.generate_html_associations(sweetviz_report, "source")
if sweetviz_report.associations_html_compare:
sweetviz_report.associations_html_compare = sv_html.generate_html_associations(sweetviz_report, "compare")
_page_html = sv_html.generate_html_dataframe_page(sweetviz_report)
return _page_html
Copy this to your notebook:
5. ? Incorta, Inc. All Rights Reserved Internal Use Only
Using Incorta Notebook - Analyze a data set
5
my_report = sv.analyze([pdf,'Train'], target_feat='SalePrice')
Pandas DataFrame Label Column Name
6. ? Incorta, Inc. All Rights Reserved Internal Use Only
Using Incorta Notebook - Compare two data sets
6
my_report = sv.compare([input_pdf1,'Train'], target_feat='Survived', compare= [input_pdf2, 'Test'])
7. ? Incorta, Inc. All Rights Reserved Internal Use Only
Using Incorta Notebook - Zeppelin Display System
7
print("%angular <h2>sweetviz Report</h2>" + show_html(my_report))
Incorta extension
Copy this to your notebook:
The report is shown
as the output of the
paragraph
8. ? Incorta, Inc. All Rights Reserved Internal Use Only
Using Incorta Notebook - Launch the Sweetviz HTML
report in a separate browser tab
8