Facets Overview

1.1.1 · abandoned · verified Fri Apr 17

Facets Overview is a Python library that generates interactive visualizations for analyzing machine learning datasets. It processes data into protobufs, which are then rendered by front-end web components (Polymer). The library is currently at version 1.1.1, with the last release in 2017, indicating it is no longer actively maintained.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to generate and display a Facets Overview visualization within a Jupyter Notebook. It uses `pandas` for data handling and `IPython.display` to render the interactive HTML. Note that this requires the `facets_overview` Jupyter nbextension to be enabled and an environment compatible with Polymer 2.

import pandas as pd
from facets_overview.generic_feature_statistics_generator import GenericFeatureStatisticsGenerator
from IPython.display import display, HTML

# Example data
data = [
    {'feature1': 1, 'feature2': 'cat'},
    {'feature1': 2, 'feature2': 'dog'},
    {'feature1': 3, 'feature2': 'cat'}
]
df = pd.DataFrame(data)

# Create the FeatureStatisticsList proto for Facets Overview.
gfsg = GenericFeatureStatisticsGenerator()
overview_proto = gfsg.CreateFeatureStatisticsListFromDataFrame(df)
protostr = overview_proto.SerializeToString().decode('utf-8')

# Display the Facets Overview UI (requires Jupyter Notebook and nbextension enabled)
HTML_TEMPLATE = """<link rel="import" href="/nbextensions/facets_overview/facets-overview.html">
        <facets-overview id="facets-overview"></facets-overview>
        <script>
          document.querySelector("#facets-overview").protoInput = "{protostr}";
        </script>"""
html_output = HTML_TEMPLATE.format(protostr=protostr)
display(HTML(html_output))

view raw JSON →