KMeans.fit_predict¶
- KMeans.fit_predict(data)¶
Fits the estimator using the provided data and subsequently predicts the labels for the data using the fitted estimator. It simply chains calls to
fit()
andpredict()
.- Parameters:
data (
TypeVar
(D_contra
, contravariant=True)) -- The data to use for fitting and to predict labels for. The data must have the same type as for thefit()
method.- Return type:
TypeVar
(R_co
, covariant=True)- Returns:
The predicted labels. Consult the
predict()
documentation for more information on the return type.