pythonscikit-learncomputer-visionmean-shift

Scikit-learn: What are the labels returned by MeanShift fit_predict()


I am trying to segment a colour image using the Mean-Shift algorithm using scikit-learn. There is something I would like to know about the MeanShift fit_predict() function. In the documentation for the MeanShift algorithm, it states that fit_predict() performs clustering on X and returns cluster labels.

What exactly are the cluster labels? Are they the labels for all the clusters the algorithm found, or is there a label for each data sample returned? Any insights are appreciated.


Solution

  • There is a label returned for each training example. It is a combination of the fit() and the predict() function.