我一直在尝试使用 Weka 的 DBSCAN 集群器来集群实例。据我了解,我应该为此使用该clusterInstance()
方法,但令我惊讶的是,在查看该方法的代码时,看起来实现忽略了参数:
/**
* Classifies a given instance.
*
* @param instance The instance to be assigned to a cluster
* @return int The number of the assigned cluster as an integer
* @throws java.lang.Exception If instance could not be clustered
* successfully
*/
public int clusterInstance(Instance instance) throws Exception {
if (processed_InstanceID >= database.size()) processed_InstanceID = 0;
int cnum = (database.getDataObject(Integer.toString(processed_InstanceID++))).getClusterLabel();
if (cnum == DataObject.NOISE)
throw new Exception();
else
return cnum;
}
这似乎不对。那应该如何工作?我应该使用其他方法进行聚类吗?如果我想从中获取任何有用的信息,我是否必须在所有实例上按特定顺序依次运行此方法?