I'm wondering why before clustering the global Landsat-7 image in this tutorial, the authors first trained the clusterer on a subset region around Egypt?

Since the Kmean algorithm is supposed to be unsupervised, I though there was no need to train it beforehand.

The line of code I'm puzzled about is this one:

var clusterer = ee.Clusterer.wekaKMeans(15).train(training);

Is the train() method above the equivalent of the method fit() in Scikit-learn?


Both unsupervised and supervised learning models are trained using a set of training data, but the characteristics of the training data differ.

Unsupervised learning models only on require unlabled training data. In Earth Engine these models are trained using ee.Cluster.train(), using the features and inputProperties arguments to specify the unlabeled training data.

Supervised learning models require labeled training data. In Earth Engine these models are trained using ee.Classifier.train(), using the features, classProperty and inputProperties arguments to specify the labeled training data, with the extra classProperty indicating the data labels.

  • What's the point of the training in the Unsupervised models? Can't we just skip it and perform the clustering directly on the larger image in the Google Earth Engine example? – Hakim Oct 23 '17 at 22:28
  • A separate training step allows you to train a model on a region of an image, and apply the model to the same region, a different region or a different image altogether. – Tyler Erickson Oct 24 '17 at 0:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.