如何解决使用阈值进行聚类以了解聚类数
我需要实现一组集合(聚类数据)
使用阈值
每个元素都有函数 distance 返回两个元素之间的距离
我尝试开始,但不知道如何继续
public class AgglomerativeClustering <T extends Clusterable<T>> implements Clustering<T>{
double threshold;
public AgglomerativeClustering(double threshold) {
this.threshold = threshold;
}
public Set<Set<T>> clusterSet(Set<T> elements) {
if(elements.size() >0){
T obj = null;
for (Iterator<T> it = elements.iterator(); it.hasNext(); ) {
T f = it.next();
if(obj == null) obj = f;
if (f.distance(obj) < threshold){
}
}
}
// TODO: Complete
return null;
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。