.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/05_maps/plot_05_lattice_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_05_maps_plot_05_lattice_upset.py: Lattices and UpSet plots ======================== The frequent patterns are ordered by containment: the Hasse diagram draws an edge from every pattern to its one-item super-patterns, one row per length, closed patterns ringed. The UpSet plot (Lex et al., 2014) answers a different question: which of the top patterns occur *together* in the same sequences? .. GENERATED FROM PYTHON SOURCE LINES 10-21 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/05_maps/images/sphx_glr_plot_05_lattice_upset_001.png :alt: pattern lattice (containment order); closed patterns ringed :srcset: /auto_examples/05_maps/images/sphx_glr_plot_05_lattice_upset_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/05_maps/images/sphx_glr_plot_05_lattice_upset_002.png :alt: UpSet plot of the supporting sequences of the top 7 patterns :srcset: /auto_examples/05_maps/images/sphx_glr_plot_05_lattice_upset_002.png :class: sphx-glr-multi-img .. code-block:: Python import matplotlib.pyplot as plt import spmviz as sv from spmviz.viz import plot_lattice, plot_upset db = sv.datasets.make_daily_routines(300, random_state=0) ps = sv.mine(db, 0.35, max_gap=2, max_length=4) plot_lattice(ps, max_length=4, top_per_level=9) plot_upset(ps.filter(min_length=2), top=7) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.223 seconds) .. _sphx_glr_download_auto_examples_05_maps_plot_05_lattice_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/spmviz/main?urlpath=lab/tree/notebooks/auto_examples/05_maps/plot_05_lattice_upset.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_05_lattice_upset.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_05_lattice_upset.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_05_lattice_upset.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_