如何设定层次集群的限制
我有一个类似的数据集:
C1 | C2 | C3 | C4 | C5 | R1 |
---|---|---|---|---|---|
3 | 7 | 4 | 3 | 5 | R2 |
4 | 2 | 6 | 5 | 2 | R3 |
8 | 4 | 4 | 4 | 6 | 2 |
R4 | 9 | 4 | 5 | 6 | 2 |
R5 | 3 | 7 | 4 | 5 | 8 8 |
R6 | 2 | 6 | 9 | 1 | 10 |
# 每行的元素确定位置之间的距离。例如,R1和C2之间的距离为7公里。
现在我的问题是:如何设置一个限制,以防止其值大于5?!换句话说,分层算法不包括它们的计算。 请帮助我解决这个问题。 谢谢。
I have a dataset like this :
# | c1 | c2 | c3 | c4 | c5 |
---|---|---|---|---|---|
r1 | 3 | 7 | 4 | 3 | 5 |
r2 | 4 | 2 | 6 | 5 | 2 |
r3 | 8 | 4 | 4 | 6 | 2 |
r4 | 9 | 4 | 5 | 6 | 2 |
r5 | 3 | 7 | 4 | 5 | 8 |
r6 | 2 | 6 | 9 | 1 | 10 |
and the elements in each row determine the distance between locations. for example distance between r1 and c2 is 7 km.
now my question is: how can I set a limitation that prevents clustering for elements that their values are bigger than 5 ?! in other words, hierarchical algorithm Does not include them in it's calculations.
please help me to solve this problem.
thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用Sklearn的聚集聚类进行建模,提供
5
在decode> decond_threshold
参数如下:有关更多信息,请检查此博客
[https://www.analyticsvidhya.com/blog/2019/05/beginners-guide-hierarchical-clustering/] [1]
Modelling using sklearn's agglomerative clustering, provide
5
indistance_threshold
parameter as follows:For more information, check this blog
[https://www.analyticsvidhya.com/blog/2019/05/beginners-guide-hierarchical-clustering/][1]