1

I am a beginner in Python and Orange tool for data mining. I have been trying out a few examples which worked as expected. KMeans clustering also works fine. 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/

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

Anu145
  • 115
  • 1
  • 10

1 Answers1

2

Judging from the Orange documentation (hint, hint), the class is not (or no longer) in the Orange.misc package, but one level higher.

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

Seriously, you need to learn your python basics.

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!). 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 - is the first statement needed?

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194