当前位置:网站首页>Google Earth Engine(GEE)——Kmeans聚类快速进行土地分类(双for循环快速调参)
Google Earth Engine(GEE)——Kmeans聚类快速进行土地分类(双for循环快速调参)
2022-06-12 11:37:00 【华为云】
k均值聚类算法(k-means clustering algorithm)是一种迭代求解的聚类分析算法,其步骤是,预将数据分为K组,则随机选取K个对象作为初始的聚类中心,然后计算每个对象与各个种子聚类中心之间的距离,把每个对象分配给距离它最近的聚类中心。聚类中心以及分配给它们的对象就代表一个聚类。每分配一个样本,聚类的聚类中心会根据聚类中现有的对象被重新计算。这个过程将不断重复直到满足某个终止条件。终止条件可以是没有(或最小数目)对象被重新分配给不同的聚类,没有(或最小数目)聚类中心再发生变化,误差平方和局部最小。
我们本次是研究通过不同的参数调整来实验我们的研究对象,当然可以叠加多层for循环查看结果,这次我们分别对分类的个数各所选择的初始化的分类方法进行for循环,剩下的所有参数都采用默认状态进行。
ee.Clusterer.wekaKMeans(nClusters, init, canopies, maxCandidates, periodicPruning, minDensity, t1, t2, distanceFunction, maxIterations, preserveOrder, fast, seed)
使用k means算法对数据进行聚类。可以使用欧氏距离(默认)或曼哈顿距离。如果使用曼哈顿距离,那么中心点将被计算为分量上的中位数而不是平均值。更多信息见。
参数。
nClusters(整数)。
集群的数量。
init(整数,默认:0)。
使用的初始化方法。0=随机,1=k-means++,2=canopy,3=farthest first。
canopies(布尔值,默认:false)。
使用canopies来减少距离计算的次数。
maxCandidates(整数,默认:100)。
使用树冠聚类时,任何时候在内存中保留的候选树冠的最大数量。T2距离加上数据特性,将决定在进行定期和最终修剪之前形成多少个候选树冠,这可能会导致内存消耗过大。这个设置可以避免大量的候选树冠消耗内存。
periodicPruning(整数,默认:10000)。
当使用树冠聚类时,多久修剪一次低密度树冠。
minDensity(整数,默认为2)。
使用树冠聚类时的最小树冠密度,低于该密度的树冠将在定期修剪中被修剪。
t1(Float,默认:-1.5)。
使用树冠聚类时要使用的T1距离。一个<0的值被当作T2的正数倍。
t2(浮点数,默认为-1)。
使用冠层聚类时要使用的T2距离。值<0会导致使用基于属性标准差的启发式方法。
distanceFunction(字符串,默认为 "欧几里得")。
要使用的距离函数。选项是。欧几里得和曼哈顿
maxIterations(整数,默认为空)。
迭代的最大次数。
preserveOrder(布尔值,默认为false)。
保留实例的顺序。
fast(布尔值,默认为false)。
启用更快的距离计算,使用切分值。禁用平方误差/距离的计算/输出。
seed(整数,默认为10)。
随机化种子。
返回。聚类器
引用:
D. Arthur, S. Vassilvitskii: k-means++: the advantages of careful seeding. In: Proceedings of the eighteenth annual ACM-SIAM symposium on Discrete algorithms, 1027-1035, 2007.
这里我们看结果:
1次聚类的结果:
分类结果为5的结果:
分类为10的结果
分类17的结果:
代码:(823条消息) Google Earth Engine(GEE)——Kmeans聚类快速进行土地分类(双for循环快速调参)_此星光明2021年博客之星云计算Top3的博客-CSDN博客
边栏推荐
- Leetcode 162 Looking for peak value (June 11, 2022)
- How to view glibc version
- DS18B20数字温度计 (一) 电气特性, 寄生供电模式和远距离接线
- Process creation and recycling
- Redis keys in PHP
- redis 總結
- NLP data set download address for naturallanguageprocessing
- UI自动化测试中比较少见的异常记录
- 35. 搜索插入位置
- [the 11th national competition of Blue Bridge Cup single chip microcomputer]
猜你喜欢

正则表达式 | 浅解

SOT23(Small Outline Transistor)

Lambda and filter, List 和 numpy array的索引,以及各种距离指标distance-metrics,拼接数组以及axis=0 and axis=1的区分

C# 35. Select default network card

Design of virtual scrolling list

VirtualBox virtual machine shut down due to abnormal system. The virtual machine startup item is missing

Pytorch笔记

Socket Programming TCP

Clickhouse column basic data type description

Manuscript manuscript format preparation
随机推荐
FormatConversionTool.exe
MCUXpresso开发NXP RT1060(3)——移植LVGL到NXP RT1060
QT based travel query and simulation system
【clickhouse专栏】基础数据类型说明
Architecture training module 7
Doris记录服务接口调用情况
Deep learning and CV tutorial (14) | image segmentation (FCN, segnet, u-net, pspnet, deeplab, refinenet)
Go sends SMS based on alicloud
Doris records service interface calls
AcWing 1921. 重新排列奶牛(环图)
When you have a server
Problems in cross validation code of 10% discount
Les humains veulent de l'argent, du pouvoir, de la beauté, de l'immortalité, du bonheur... Mais les tortues ne veulent être qu'une tortue.
单元测试用例框架--unittest
UML系列文章(30)体系结构建模---制品图
Windows10 install mysql-8.0.28-winx64
Design of secure chat tool based on C #
K58. Chapter 1 installing kubernetes V1.23 based on kubeadm -- cluster deployment
2022-06-11: note that in this document, graph is not the meaning of adjacency matrix, but a bipartite graph. In the adjacency matrix with length N, there are n points, matrix[i][j]
Logrotate log rotation method create and copyruncate principles





