discrimintools.fviz_plsr_ind#
- discrimintools.fviz_plsr_ind(obj, axis=[0, 1], geom_ind=('point', 'text'), repel=False, point_args_ind={'shape': 'o', 'size': 1.5}, text_args_ind={'size': 8}, add_group=True, geom_group=('point', 'text'), point_args_group={'shape': '^', 'size': 3}, text_args_group={'size': 11.5}, palette=None, x_lim=None, y_lim=None, x_label=None, y_label=None, title=None, add_hline=True, add_vline=True, add_grid=True, ggtheme=None)[source]#
-
Visualize Partial Least Squares Regression - Graph of individuals
fviz_plsr_indprovides plotnine based elegant visualization ofCPLS,PLSDA,PLSLDAandPLSLOGIToutputs for individuals.- Parameters:
-
obj (class) – An instance of class
CPLS,PLSDA,PLSLDA,PLSLOGIT.axis (list, defaul=[0,1]) – Dimensions to be plotted.
-
geom_ind (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.
point_args_ind (dict, default=dict(shape = “o”, size = 1.5)) – Keywords arguments for geom_point.
text_args_ind (dict, default=dict(size = 8)) – Keywords arguments for geom_text.
add_group (bool, default = True) – To show group coordinates.
geom_group (str, list or tuple, default = (‘point’,’text’)) – See
geom_ind.point_args_group (dict, default = dict(shape = “^”, size = 3)) – See
point_args_ind.text_args_group (dict, default=dict(size = 11.5)) – See
text_args_ind.palette (None or list, default=None) – Color palette to be used for coloring by groups.
x_lim (None, list or tuple, default=None) – The range of the plotted
xvalues.y_lim (None, list or tuple, default=None) – 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_plsr-
Visualize Partial Least Squares Regression (CPLS, PLSDA, PLSLDA, PLSLOGIT).
fviz_plsr_var-
Visualize Partial Least Squares Regression (CPLS, PLSDA, PLSLDA, PLSLOGIT) - Graph of variables.
fviz_dist-
Visualize distance between barycenter.
Examples
>>> from discrimintools.datasets import load_dataset >>> from discrimintools import CPLS, fviz_plsr_ind >>> D = load_dataset("breast") # load traning data >>> y, X = D["Class"], D.drop(columns=["Class"]) # split into X and y >>> clf = CPLS() >>> clf.fit(X,y) CPLS() >>> p = fviz_plsr_ind(clf) # graph of individuals >>> print(p)
Fig. 20 Graph of individuals - CPLS#