elbow

In [ ]:
elbow(input_relation: (str, vDataFrame),
      X: list = [],
      n_cluster: (tuple, list) = (1, 15),
      init: (str, list) = "kmeanspp",
      max_iter: int = 50,
      tol: float = 1e-4,
      ax=None,
      **style_kwds,)

Draws an Elbow curve.

Parameters

Name Type Optional Description
input_relation
str
Relation to use to train the model.
X
list
List of the predictor columns. If empty all the numerical vcolumns will be used.
n_cluster
tuple / list
Tuple representing the number of cluster to start with and to end with. It can also be customized list with the different K to test.
init
str / list
The method to use to find the initial cluster centers.
  • kmeanspp : Uses the KMeans++ method to initialize the centers.
  • random : The initial centers.
It can be also a list with the initial cluster centers to use.
max_iter
int
The maximum number of iterations the algorithm performs.
tol
float
Determines whether the algorithm has converged. The algorithm is considered converged after no center has moved more than a distance of 'tol' from the previous iteration.
ax
Matplotlib axes object
The axes to plot on.
**style_kwds
any
Any optional parameter to pass to the Matplotlib functions.

Returns

tablesample : An object containing the result. For more information, see utilities.tablesample.

Example

In [8]:
from verticapy.learn.model_selection import elbow
elbow(input_relation = "public.iris",
      X = ["PetalLengthCm", "PetalWidthCm"])
Out[8]:
Within-Cluster SS
10.0
20.8430854905080415
30.9429226137921877
40.9631049651782849
50.974234707623065
60.9757984417757647
70.981234463744753
80.9849184082760484
90.9832711354953506
100.986486392002433
110.9898109388276228
120.9900775360143651
130.9914697617316701
140.9924304741142214
Rows: 1-14 | Columns: 2