KMeans.fit

KMeans.fit(data)[source]

Fits the KMeans model on the provided data by running Lloyd's algorithm.

Parameters:

data (Union[ndarray[Any, dtype[float32]], Tensor]) -- The tabular data to fit on. The dimensionality of the KMeans model is automatically inferred from this data.

Return type:

KMeans

Returns:

The fitted KMeans model.