discrimintools.fviz_dica_quali_var#
- discrimintools.fviz_dica_quali_var(obj, axis=[0, 1], geom_var=('point', 'text'), repel=False, col_var='blue', point_args_var={'shape': 'o', 'size': 1.5}, text_args_var={'size': 8}, x_lim=(0, 1), y_lim=(0, 1), x_label=None, y_label=None, title=None, add_hline=True, add_vline=True, add_grid=True, ggtheme=None)[source]#
-
Visualize Discriminant Correspondence Analysis (DiCA) - Graph of qualitative variables
Discriminant correspondence analysis (DiCA) is a canonical discriminant analysis on qualitative predictors.
fviz_dica_quali_varprovides plotnine based elegant visualization of DiCA outputs for qualitative variables.- Parameters:
-
obj (class) – An instance of class
DiCA.axis (list, defaul = [0,1]) – Dimensions to be plotted.
-
geom_var (str, list or tuple, default = (‘point’,’text’)) – Geometry to be used for the graph. Possible values are the combinaison of [“point”,”text”].
‘point’ to show only points,
‘text’ to show only labels,
(‘point’,’text’) to show both types.
repel (bool, default = False) – To avoid overplotting text labels.
col_var (str, default = ‘blue’) – Color for the qualitative variables points and texts.
point_args_var (dict, default = dict(shape = “o”, size = 1.5)) – Keywords arguments for geom_point.
text_args_var (dict, default = dict(size = 8)) – Keywords arguments for geom_text.
x_lim (None, list or tuple, default = (0,1)) – The range of the plotted
xvalues.y_lim (None, list or tuple, default = (0,1)) – The range of the plotted
yvalues.x_label (None or str, default = None) – The label text of
x.y_label (None or str, default = None) – The label text of
y.title (None or str, default = None) – The title of the graph you draw.
add_hline (bool, default = True) – To add a horizontal line.
add_vline (bool, default = True) – To add a vertical line.
add_grid (bool, default = True) – To add grid customization.
ggtheme (function, default=None) – Plotnine theme name.
- Returns:
-
p – A object of class ggplot.
- Return type:
-
class
See also
fviz_dica-
Visualize Discriminant Correspondence Analysis (DiCA)
fviz_dica_biplot-
Visualize Discriminant Correspondence Analysis (DiCA) - Biplot of individuals and variables
fviz_dica_ind-
Visualize Discriminant Correspondence Analysis (DiCA) - Graph of individuals
fviz_dica_var-
Visualize Discriminant Correspondence Analysis (DiCA) - Graph of variables/categories
fviz_dist-
Visualize distance between barycenter.
Examples
>>> from discrimintools.datasets import load_divay >>> from discrimintools import DiCA, fviz_dica_quali_var >>> D = load_divay("train") # load training data >>> y, X = D["Region"], D.drop(columns=["Region"]) # split into X and y >>> clf = DiCA() >>> clf.fit(X,y) DiCA() >>> p = fviz_dica_quali_var(clf) # graph of qualitative variables >>> print(p)
Fig. 14 Graph of qualitative variables - DiCA#