Note
Go to the end to download the full example code or to run this example in your browser via Binder
Plot numerical features#
plots qualitative (numerical) features distribution using correlative aspect.
# Author: L.Kouadio
# Licence: BSD-3-clause
from watex.view.plot import QuickPlot
from watex.datasets import load_bagoue
from watex.utils import smart_label_classifier
data = load_bagoue ().frame
demo_features =['ohmS', 'power', 'lwi', 'flow']
data_area=data [demo_features]
# use smart label classifier to encode ohmS features
# categorized the ohmS series into a class labels 'oarea1', 'oarea2' and 'oarea3'
data_area ['ohmS'] = smart_label_classifier (data_area.ohmS, values =[1000, 2000 ])
qkObj = QuickPlot(mapflow =False, tname="ohmS"
).fit(data_area)
qkObj.sns_style ='ticks',
qkObj.fig_title='Quantitative features correlation'
qkObj.fig_size =(7, 5)
sns_pkws={'aspect':2 ,
"height": 2,
# ... 'markers':['o', 'x', 'D', 'H', 's',
# '^', '+', 'S'],
'diag_kind':'kde',
'corner':False,
}
marklow = {'level':4,
'color':".2"}
qkObj.numfeatures(coerce=True, map_lower_kws=marklow, **sns_pkws)

/home/docs/checkouts/readthedocs.org/user_builds/watex/checkouts/0.2.5/watex/utils/funcutils.py:4557: UserWarning:
Values (1000.0, 2000.0) are missing in the array. (1000.68133, 2010.1625) are approximatively used for substituting the (1000.0, 2000.0).
/home/docs/checkouts/readthedocs.org/user_builds/watex/checkouts/0.2.5/examples/view/plot_num_features.py:21: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
/home/docs/checkouts/readthedocs.org/user_builds/watex/envs/0.2.5/lib/python3.10/site-packages/seaborn/distributions.py:1185: UserWarning:
The following kwargs were not used by contour: 'level'
/home/docs/checkouts/readthedocs.org/user_builds/watex/envs/0.2.5/lib/python3.10/site-packages/seaborn/distributions.py:1185: UserWarning:
The following kwargs were not used by contour: 'level'
/home/docs/checkouts/readthedocs.org/user_builds/watex/envs/0.2.5/lib/python3.10/site-packages/seaborn/distributions.py:1185: UserWarning:
The following kwargs were not used by contour: 'level'
QuickPlot(savefig= None, fig_num= 1, fig_size= (7, 5), ... , classes= None, tname= ohmS, mapflow= False)
Total running time of the script: ( 0 minutes 2.943 seconds)