.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/04_flows/plot_04_growth_sankey.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_04_flows_plot_04_growth_sankey.py: How support splits when sequences grow ====================================== A new view of the extension network: columns are pattern lengths, ribbons carry the support of a pattern to its one-event extensions, and the rest of the support (the sequences in which the pattern is not continued by a kept child) flows to *stop*. It reads like a funnel of frequent sequences. .. GENERATED FROM PYTHON SOURCE LINES 10-19 .. code-block:: Python import matplotlib.pyplot as plt import spmviz as sv from spmviz.viz import plot_growth_sankey db = sv.datasets.make_daily_routines(300, random_state=0) ps = sv.mine(db, 0.25, max_gap=1, max_length=5) plot_growth_sankey(ps, start_items=["wake up"], max_length=5, top=3) .. image-sg:: /auto_examples/04_flows/images/sphx_glr_plot_04_growth_sankey_001.png :alt: support flow of growing sequences :srcset: /auto_examples/04_flows/images/sphx_glr_plot_04_growth_sankey_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 20-22 Two starting activities ----------------------- .. GENERATED FROM PYTHON SOURCE LINES 22-24 .. code-block:: Python plot_growth_sankey(ps, start_items=["work", "lunch"], max_length=4, top=3) plt.show() .. image-sg:: /auto_examples/04_flows/images/sphx_glr_plot_04_growth_sankey_002.png :alt: support flow of growing sequences :srcset: /auto_examples/04_flows/images/sphx_glr_plot_04_growth_sankey_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.113 seconds) .. _sphx_glr_download_auto_examples_04_flows_plot_04_growth_sankey.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/04_flows/plot_04_growth_sankey.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_04_growth_sankey.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_04_growth_sankey.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_04_growth_sankey.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_