.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/02_matrix_views/plot_08_upset.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via Binder. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_02_matrix_views_plot_08_upset.py: UpSet view of frequent theme combinations ========================================= UpSet plots (Lex et al. 2014) list set intersections as columns of a dot matrix with bar charts. Applied to a hypergraph of frequent itemsets, every column is a combination of themes and its bar is the support. .. GENERATED FROM PYTHON SOURCE LINES 11-21 .. image-sg:: /auto_examples/02_matrix_views/images/sphx_glr_plot_08_upset_001.png :alt: the 18 most frequent theme combinations :srcset: /auto_examples/02_matrix_views/images/sphx_glr_plot_08_upset_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none itemset size count support 0 (TEMPERATURE, EMISSIONS) 2 81.0 0.180000 1 (CLIMATE, EMISSIONS) 2 77.0 0.171111 2 (CLIMATE, TEMPERATURE) 2 74.0 0.164444 3 (TEMPERATURE, IPCC) 2 74.0 0.164444 4 (COAL, OIL_GAS) 2 73.0 0.162222 5 (EMISSIONS, IPCC) 2 73.0 0.162222 6 (FLOOD, DROUGHT) 2 70.0 0.155556 7 (CLIMATE, IPCC) 2 67.0 0.148889 | .. code-block:: Python import hatvis as hv from hatvis.plotting import plot_upset T = hv.datasets.make_news_transactions(n_per_period=150, random_state=0) # [snippet:upset] fi = hv.frequent_itemsets(T, min_support=0.06, min_size=2) IH = hv.itemset_hypergraph(fi.head(18)) fig, axes = plot_upset(IH, title="the 18 most frequent theme combinations") # [/snippet:upset] print(fi.head(8).to_string()) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.281 seconds) .. _sphx_glr_download_auto_examples_02_matrix_views_plot_08_upset.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/ComplexSystemsIntelligence/hatvis/main?urlpath=lab/tree/notebooks/auto_examples/02_matrix_views/plot_08_upset.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_08_upset.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_08_upset.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_08_upset.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_