---
title: "Discussion on \"Earth Engine Tutorial #31: Machine Learning with Earth Engine - Unsupervised Classification\" | Hashnode"
description: "Discussion on \"Earth Engine Tutorial #31: Machine Learning with Earth Engine - Unsupervised Classification\". This tutorial shows you how to perform unsupervised classification (e.g., KMeans clustering) in Earth Engine.\nUnsupervised classification algorithms available in Earth Engine\nSource: https://developers.google.com/earth-engine/clustering\nThe ee.Cluste..."
url: "https://hashnode.com/posts/earth-engine-tutorial-31-machine-learning-with-earth-engine-unsupervised-classification/5f2d4c8c3b12e25afe3e4715"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Earth Engine Tutorial #31: Machine Learning with Earth Engine - Unsupervised Classification](https://blog.gishub.org/earth-engine-tutorial-31-machine-learning-with-earth-engine-unsupervised-classification?utm_source=hashnode&utm_medium=feed)

This tutorial shows you how to perform unsupervised classification (e.g., KMeans clustering) in Earth Engine. Unsupervised classification algorithms available in Earth Engine Source: https://developers.google.com/earth-engine/clustering The ee.Cluste...

Aug 7, 2020 · 3 min read · blog.gishub.org  
Read the article

-   [#earth-engine](https://hashnode.com/tag/earth-engine)
-   [#machine-learning](https://hashnode.com/tag/machine-learning)
-   [#gis](https://hashnode.com/tag/gis)
-   [#python](https://hashnode.com/tag/python)

## Written by

[Qiusheng Wu](https://hashnode.com/@giswqs)

@giswqs · Knoxville, TN

  
[View profile](https://hashnode.com/@giswqs)

Associate Professor of Geography at the University of Tennessee, Knoxville

Dr. Qiusheng Wu is an Associate Professor in the Department of Geography &amp; Sustainability at the University of Tennessee, Knoxville. He is also an Amazon Visiting Academic and a Google Developer Expert (GDE) for Earth Engine. His research interests include geospatial data science, remote sensing, and environmental modeling. Dr. Wu is particularly interested in utilizing big geospatial data and cloud computing (e.g., Google Earth Engine, Microsoft Planetary Computer, Amazon Web Services) to study environmental change, especially surface water and wetland inundation dynamics. His research has been funded by NASA, USDA, and the Department of Defense. Dr. Wu is an advocate of open science and reproducible research, having developed and published various open-source packages for advanced geospatial analysis and data visualization, such as geemap, leafmap, lidar, and segment-geospatial. Check out his open-source projects at https://open.gishub.org

## Responses 4

Markdown supported · ⌘↵ to post

[Gayle Tyree](https://hashnode.com/@gltyree)

[Dec 2, 2022](https://hashnode.com/posts/earth-engine-tutorial-31-machine-learning-with-earth-engine-unsupervised-classification/5f2d4c8c3b12e25afe3e4715/comment/638a88f21338cf81a87656bf)

Professor,

Thank you for this excellent post. To your knowledge, is it possible to do fuzzy clustering (soft K-means) in addition to the classic K-means clustering with the Google Earth Engine algorithms?

[Danyang Yu](https://hashnode.com/@Rachel777)

[Dec 9, 2021](https://hashnode.com/posts/earth-engine-tutorial-31-machine-learning-with-earth-engine-unsupervised-classification/5f2d4c8c3b12e25afe3e4715/comment/61b20bcb1907c16be2ee055a)

Just what I need!

[Balazs Kisfali](https://hashnode.com/@Biagio74)

[Nov 2, 2020](https://hashnode.com/posts/earth-engine-tutorial-31-machine-learning-with-earth-engine-unsupervised-classification/5f2d4c8c3b12e25afe3e4715/comment/5fa030d9701b426a98096a12)

Hi Qiusheng, thanks for this article, it is very useful. Its great that we can use now ee in proper Python environment ;) ...I have two questions. Q1: the centroids of the each clusters (let say NDVI values) are always in an ascending order? Q2: how can we get the centroid values from the each cluster? Thank you ;)

[Qiusheng Wu](https://hashnode.com/@giswqs)

[Nov 2, 2020](https://hashnode.com/posts/earth-engine-tutorial-31-machine-learning-with-earth-engine-unsupervised-classification/5f2d4c8c3b12e25afe3e4715/comment/5fa030d9701b426a98096a12#reply-5fa04ee9701b426a98096caf)

I don't understand your Q1. For Q2, you can convert raster to vector to get centroids.

[Balazs Kisfali](https://hashnode.com/@Biagio74)

[Nov 3, 2020](https://hashnode.com/posts/earth-engine-tutorial-31-machine-learning-with-earth-engine-unsupervised-classification/5f2d4c8c3b12e25afe3e4715/comment/5fa030d9701b426a98096a12#reply-5fa0efb7ad30887ef1e164e6)

Hi [Qiusheng Wu](https://hashnode.com/@giswqs), Thank you for your prompt reply. In Q1 I meant that, let say that I have an image and calculated the NDVI indexes. I choose 3 clusters. NDVI values will be between 0.1 and 0.7 in my image. The higher values are representing high vegetation, the medium values low vegetation, and the lower values other land types. Let's assume that the cluster centroids will be around 0.2, 0.4 and 0.6. My Q1 question is, will these values will return in ascending order respective to the cluster IDs? So cluster 0 represents 0.2, cluster 1 represents 0.4, and cluster 2 represents 0.6? In Q2 question actually I don't want to know the physical location of the centroids, but only the KMeans, the values, like 0.2, 0.4 and 0.6 in this example. How to get those?

[Hafez Ahmad](https://hashnode.com/@Hafez)

[Aug 7, 2020](https://hashnode.com/posts/earth-engine-tutorial-31-machine-learning-with-earth-engine-unsupervised-classification/5f2d4c8c3b12e25afe3e4715/comment/5f2d4e16b8ac395b1f23a0ae)

Dear Professor You made my day.excellent post.I love it.
