Plot pairwise features#

creates a pairwise comparison between features.

# Author: L.Kouadio
# Licence: BSD-3-clause

Plot the numerical pairwise correlation It shows [‘pearson’|’spearman’|’covariance’] correlation.

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 )
Pearson Ranking of 9 Features
<'ExPlot':xname=None, yname=None , tname='flow'>

Plot the categorical pairwise correlation For visulizing the categorical features using the spearman rho correlation

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 )
Spearman Ranking of 4 Features
/home/docs/checkouts/readthedocs.org/user_builds/watex/envs/0.2.1/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'>

Total running time of the script: ( 0 minutes 0.346 seconds)

Gallery generated by Sphinx-Gallery