watex.view.QuickPlot.scatteringfeatures#
- QuickPlot.scatteringfeatures(features, *, relplot_kws=None, **sns_kws)[source]#
Draw a scatter plot with possibility of several semantic features groupings.
Indeed scatteringfeatures analysis is a process of understanding how features in a dataset relate to each other and how those relationships depend on other features. Visualization can be a core component of this process because, when data are visualized properly, the human visual system can see trends and patterns that indicate a relationship.
- Parameters
features (list) – List of numerical features to plot for correlating analyses. will raise an error if features does not exist in the data
relplot_kws (dict, optional) – Extra keyword arguments to show the relationship between two features with semantic mappings of subsets. refer to <http://seaborn.pydata.org/generated/seaborn.relplot.html#seaborn.relplot> for more details.
sns_kwargs (dict, optional) – kwywords arguments to control what visual semantics are used to identify the different subsets. For more details, please consult <http://seaborn.pydata.org/generated/seaborn.scatterplot.html>.
data (str or pd.core.DataFrame) – Path -like object or Dataframe. Long-form (tidy) dataset for plotting. Each column should correspond to a variable, and each row should correspond to an observation. If data is given as path-like object,`QuickPlot` reads and sanitizes data before plotting. Be aware in this case to provide the target name and possible the classes for data inspection. Both str or dataframe need to provide the name of target.
- Returns
Returns
selffor easy method chaining.- Return type
QuickPlotinstance
Notes
The argument for data must be passed to fit method. data parameter is not allowed in other QuickPlot method. The description of the parameter data is to give a synopsis of the kind of data the plot expected. An error will raise if force to pass data argument as a keyword arguments.
Examples
>>> from watex.view.plot import QuickPlot >>> from watex.datasets import load_bagoue >>> data = load_bagoue ().frame >>> qkObj = QuickPlot(lc='b', sns_style ='darkgrid', ... fig_title='geol vs lewel of water inflow', ... xlabel='Level of water inflow (lwi)', ... ylabel='Flow rate in m3/h' ... ) >>> >>> qkObj.tname='flow' # target the DC-flow rate prediction dataset >>> qkObj.mapflow=True # to hold category FR0, FR1 etc.. >>> qkObj.fit(data) >>> marker_list= ['o','s','P', 'H'] >>> markers_dict = {key:mv for key, mv in zip( list ( ... dict(qkObj.data ['geol'].value_counts( ... normalize=True)).keys()), ... marker_list)} >>> sns_pkws={'markers':markers_dict, ... 'sizes':(20, 200), ... "hue":'geol', ... 'style':'geol', ... "palette":'deep', ... 'legend':'full', ... # "hue_norm":(0,7) ... } >>> regpl_kws = {'col':'flow', ... 'hue':'lwi', ... 'style':'geol', ... 'kind':'scatter' ... } >>> qkObj.scatteringfeatures(features=['lwi', 'flow'], ... relplot_kws=regpl_kws, ... **sns_pkws, ... )