com.supermap.analyst.spatialstatistics
类 KMeansParameter

java.lang.Object
  继承者 com.supermap.analyst.spatialstatistics.KMeansParameter

public class KMeansParameter
extends java.lang.Object

K均值聚类分析参数类。该类主要用来对K均值聚类的参数进行设置。

通过K均值聚类参数设置类可以设置聚类数目、初始化方法等。


构造方法摘要
KMeansParameter()
          默认构造函数,构造一个新的KMeansParameter 对象。
KMeansParameter(KMeansParameter parameter)
          拷贝构造函数,根据给定的 KMeansParameter 对象构造一个与其完全相同的新对象。
 
方法摘要
 int getKClusters()
          返回 K均值聚类数目。
 KMeasInitMethod getKMeasInitMethod()
          返回K均值聚类中心初始化方法。
 void setKClusters(int value)
          设置 K均值聚类数目。
 void setKMeasInitMethod(KMeasInitMethod value)
          设置K均值聚类中心初始化方法。
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

KMeansParameter

public KMeansParameter()
默认构造函数,构造一个新的KMeansParameter 对象。


KMeansParameter

public KMeansParameter(KMeansParameter parameter)
拷贝构造函数,根据给定的 KMeansParameter 对象构造一个与其完全相同的新对象。

参数:
parameter - KMeansParameter 指定的 KMeansParameter 对象。
方法详细信息

getKClusters

public int getKClusters()
返回 K均值聚类数目。

返回:
K均值聚类数目。
默认值:
默认值为0。

setKClusters

public void setKClusters(int value)
设置 K均值聚类数目。

聚类数目为期望经过聚类得到的分组数。一般来说会根据对数据的先验经验选择一个合适的k值,或经过多次尝试以选取最佳数目。

参数:
value - K均值聚类数目。

getKMeasInitMethod

public KMeasInitMethod getKMeasInitMethod()
返回K均值聚类中心初始化方法。

返回:
K均值聚类中心初始化方法。
默认值:
默认为KMEASPLUSPLUS。

setKMeasInitMethod

public void setKMeasInitMethod(KMeasInitMethod value)
设置K均值聚类中心初始化方法。

K均值聚类方法的一个重要步骤为选择初始质心位置,它会对聚类结果和运行时间都有影响。组件中提供了2个初始化方法,可参考KMeasInitMethod

参数:
value - K均值聚类中心初始化方法。