.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "glr_examples/view/plot_pairwise_corr.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_glr_examples_view_plot_pairwise_corr.py: =================================== Plot pairwise features =================================== creates a pairwise comparison between features. .. GENERATED FROM PYTHON SOURCE LINES 8-11 .. code-block:: Python # Author: L.Kouadio # Licence: BSD-3-clause .. GENERATED FROM PYTHON SOURCE LINES 12-14 Plot the numerical pairwise correlation It shows ['pearson'|'spearman'|'covariance'] correlation. .. GENERATED FROM PYTHON SOURCE LINES 14-28 .. code-block:: Python from watex.datasets import fetch_data from watex.view import ExPlot from watex.utils import bi_selector data = fetch_data ('bagoue original').get('data=dfy1') # we can use the biselector for selectng the categorical and numerical # feature for plotting num_data, cat_data = bi_selector (data, return_frames= True ) p= ExPlot(tname='flow', fig_size=(7, 5)).fit(num_data) p.plotpairwisecomparison(fmt='.2f', pkg ='yb', annot=True, cmap='RdBu_r', vmin=-1, vmax=1 ) .. image-sg:: /glr_examples/view/images/sphx_glr_plot_pairwise_corr_001.png :alt: Pearson Ranking of 9 Features :srcset: /glr_examples/view/images/sphx_glr_plot_pairwise_corr_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none <'ExPlot':xname=None, yname=None , tname='flow'> .. GENERATED FROM PYTHON SOURCE LINES 29-32 Plot the categorical pairwise correlation For visulizing the categorical features using the spearman rho correlation .. GENERATED FROM PYTHON SOURCE LINES 32-41 .. code-block:: Python p= ExPlot(tname='geol', fig_size=(7, 5)).fit(cat_data) p.plotpairwisecomparison(fmt='.2f', corr='spearman', pkg ='yb', annot=True, cmap='RdBu_r', vmin=-1, vmax=1 ) .. image-sg:: /glr_examples/view/images/sphx_glr_plot_pairwise_corr_002.png :alt: Spearman Ranking of 4 Features :srcset: /glr_examples/view/images/sphx_glr_plot_pairwise_corr_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none /home/docs/checkouts/readthedocs.org/user_builds/watex/envs/0.3.2/lib/python3.10/site-packages/scipy/stats/_stats_py.py:112: RuntimeWarning: The input array could not be properly checked for nan values. nan values will be ignored. <'ExPlot':xname=None, yname=None , tname='geol'> .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.346 seconds) .. _sphx_glr_download_glr_examples_view_plot_pairwise_corr.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/watex/watex/0.3.X?urlpath=lab/tree/notebooks/glr_examples/view/plot_pairwise_corr.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_pairwise_corr.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_pairwise_corr.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_