.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/05_maps/plot_04_landscape.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_04_landscape.py: Pattern landscapes ================== A new view: the transaction map turned into a terrain. The support-weighted kernel density of the pattern coordinates is drawn as contour levels, and every peak is named after its most supported long pattern. Families of frequent patterns become mountains; isolated combinations stay in the plains. .. GENERATED FROM PYTHON SOURCE LINES 10-19 .. code-block:: Python import matplotlib.pyplot as plt import spmviz as sv from spmviz.viz import plot_landscape db = sv.datasets.make_alarm_cascades(600, random_state=0) ps = sv.mine(db, 0.05, max_length=5) plot_landscape(ps, similarity="transaction", peaks=5) .. image-sg:: /auto_examples/05_maps/images/sphx_glr_plot_04_landscape_001.png :alt: pattern landscape (density of the map weighted by support) :srcset: /auto_examples/05_maps/images/sphx_glr_plot_04_landscape_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 20-22 Parameter study: bandwidth -------------------------- .. GENERATED FROM PYTHON SOURCE LINES 22-26 .. code-block:: Python fig, axes = plt.subplots(1, 3, figsize=(15, 4.8)) for ax, bw in zip(axes, (0.15, 0.3, 0.6)): plot_landscape(ps, ax=ax, bandwidth=bw, peaks=4, title=f"bandwidth {bw}") plt.show() .. image-sg:: /auto_examples/05_maps/images/sphx_glr_plot_04_landscape_002.png :alt: bandwidth 0.15, bandwidth 0.3, bandwidth 0.6 :srcset: /auto_examples/05_maps/images/sphx_glr_plot_04_landscape_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.874 seconds) .. _sphx_glr_download_auto_examples_05_maps_plot_04_landscape.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_04_landscape.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_04_landscape.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_04_landscape.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_04_landscape.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_