discrimintools.overlap_coord#
- discrimintools.overlap_coord(coord, x_name, y_name, repel)[source]#
-
Overlap text position for segment
- Parameters:
-
coord (DataFrame of shape (n_features, n_components)) – Input data, where
n_featuresis the number of features andn_componentsis the number of components.x_name (str) – Name of columns for x axis.
y_name (str) – Name of columns for y axis.
repel (bool) – To avoid overplotting text labels.
- Returns:
-
coord – Output data.
- Return type:
-
DataFrame of shape (n_features, n_components + 2)
Examples
>>> from discrimintools.datasets import load_wine >>> from discrimintools import CANDISC, overlap_coord >>> D = load_wine("train") # load training dataset >>> y, X = D["Quality"], D.drop(columns=["Quality"]) # split into X and y >>> clf = CANDISC() >>> clf.fit(X,y) CANDISC() >>> coord = overlap_coord(clf.var_.total,"Can1","Can2",True)