简体   繁体   English

Orange工具中的分层聚类,用于数据挖掘

[英]Hierarchical clustering in Orange tool for data mining

I am a beginner in Python and Orange tool for data mining. 我是Python和Orange用于数据挖掘的工具的初学者。 I have been trying out a few examples which worked as expected. 我一直在尝试一些可以正常工作的示例。 KMeans clustering also works fine. KMeans集群也可以正常工作。 But when i tried the standard example of Hierarchical clustering given in the documentation 但是当我尝试文档中给出的标准层次集群示例时

http://orange.biolab.si/docs/latest/reference/rst/Orange.clustering.hierarchical/ http://orange.biolab.si/docs/latest/reference/rst/Orange.clustering.hierarchical/

I got the following error 我收到以下错误

matrix = Orange.misc.SymMatrix(len(iris))
AttributeError: 'module' object has no attribute 'SymMatrix'

The code is 该代码是

import Orange

iris = Orange.data.Table("iris")

matrix = Orange.misc.SymMatrix(len(iris))


clustering = Orange.clustering.hierarchical.HierarchicalClustering()
clustering.linkage = Orange.clustering.hierarchical.AVERAGE
root = clustering(matrix)

root.mapping.objects = iris

Can anyone please help me with this.. Any help is really appreciated ! 任何人都可以帮我这个忙。任何帮助都非常感谢!

Thanks in advance 提前致谢

Judging from the Orange documentation (hint, hint), the class is not (or no longer) in the Orange.misc package, but one level higher. 从Orange文档(提示,提示)来看,该类不在(或不再)在Orange.misc程序包中,而是更高一级。

http://orange.biolab.si/doc//reference/SymMatrix.htm http://orange.biolab.si/doc//reference/SymMatrix.htm

Seriously, you need to learn your python basics. 认真地讲,您需要学习python基础知识。

AttributeError: 'module' object has no attribute 'SymMatrix'

is the Python way of saying Class not found (because when it's not found, it doesn't know this is supposed to be a class!). 是Python表示未找到类的方式(因为未找到时,它不知道这应该是一个类!)。 So guess what, the class name is incorrect. 因此,请猜测是什么,类名不正确。

Furthermore, you are overwriting that value anyway, so you can just drop it altogether. 此外,您还是要覆盖该值,因此可以将其完全删除。 You havn't been programming a lot, have you? 您没有进行太多编程,对吗? a=1; a=2 a=1; a=2 - is the first statement needed? a=1; a=2是否需要第一条陈述?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM