orange2 icon indicating copy to clipboard operation
orange2 copied to clipboard

TypeError 'module' object is not callable: when calling Orange.projection.pca

Open Garch2017 opened this issue 8 years ago • 3 comments

Hi,

Can anyone help with the error below when I call the code?

import Orange iris = Orange.data.Table("iris.tab") pca = Orange.projection.linear.Pca(iris) transformed_data = pca(iris)

ERROR: import Orange iris = Orange.data.Table("iris.tab") pca = Orange.projection.pca(iris) transformed_data = pca(iris) Traceback (most recent call last): File "", line 4, in pca = Orange.projection.pca(iris) TypeError: 'module' object is not callable

Garch2017 avatar Mar 08 '17 16:03 Garch2017

The way this worked for me was:

import Orange
iris = Orange.data.Table("iris.tab")
pca = Orange.projection.pca.PCA()
transformed_data = pca(iris)

However, this is poorly documented and should be explained better. Will fix it.

ajdapretnar avatar Mar 09 '17 08:03 ajdapretnar

ajdapretnar, many thanks for your reply.

Garch2017 avatar Mar 09 '17 09:03 Garch2017

Oh, sorry. I didn't quite realize this is an Orange2 repo. Instructions might not be the same for Orange2....

ajdapretnar avatar Mar 09 '17 09:03 ajdapretnar