Orange Forum • View topic - OWC45Tree error

OWC45Tree error

A place to ask questions about methods in Orange and how they are used and other general support.

OWC45Tree error

Postby aw101 » Thu Apr 19, 2012 15:27

I installed orange on Windows 7 and and windows XP platform. I built the c45.dll as instructed using
cl.exe and link.exe via visual studio via python.exe buildc45.py script. That appeared to work no errors.

three new files appear in the site-packages/orange directory -> c45.dll, ext. lib.
the size of the c45.dll is 113kb.

I type the following command in pythonwin.exe import oranage
print oranange.version

>>> print orange.version
2.0b (19:12:26, Feb 14 2012)
>> print orange.Warning

none

>>> create Orange.classification.tree.C45Classifier()
gives me the following error

Traceback ( File "<interactive input>", line 1
create Orange.classification.tree.C45Classifier()
^
SyntaxError: invalid syntax

If I run the prepocessor node in Orange gui I get the following error messages

There were problems importing the following widgets:
OWC45Tree: c45 is not found
OWItemsetViz: No module named OWNetworkCanvas
OWModelMap: No module named scipy.stats
OWRScript: No module named r
OWPLS: No module named optimization
OWModelMapQt: No module named scipy.stats
OWLinProj3D: No module named OpenGL
OWNxExplorer3D: No module named OWNxExplorerQt
OWScatterPlot3D: No module named OpenGL
OWSphereviz3D: No module named OpenGL
The following widgets could not be imported and will not be available: OWSphereviz3D, OWC45Tree, OWModelMapQt, OWLinProj3D, OWNxExplorer3D, OWPLS, OWScatterPlot3D.
The following prototype widgets could not be imported and will not be available: OWRScript, OWModelMap, OWItemsetViz.

Unhandled exception of type KernelException occured at 15:07:40:
Traceback:
File: orngSignalManager.py, line 581 in processNewSignals
Code: self.widgets[i].processSignals()
File: OWBaseWidget.py, line 691 in processSignals
Code: self.handleNewSignals()
File: OWPreprocess.py, line 606 in handleNewSignals
Code: self.commit()
File: OWPreprocess.py, line 724 in commit
Code: data = wrap.processData(self.data)
File: __init__.py, line 495 in processData
Code: t = preprocessor(data)
File: __init__.py, line 118 in __call__
Code: newattr = self.method(attr, data)
KernelException: 'orange.DiscDistribution': invalid value

Any pointers on what I can do to fix this ?

Re: OWC45Tree error

Postby marko » Thu Apr 19, 2012 16:14

Ragarding C45: insead of typing
Code: Select all
create Orange.classification.tree.C45Classifier()
into the Python interpreter, type
Code: Select all
l = Orange.classification.tree.C45Learner()
. This will create a learner which builds a classifier when called with data (see the documentation about classification).

Do not forget to import Orange beforehand with
Code: Select all
import Orange
.

Re: OWC45Tree error

Postby aw101 » Thu Apr 19, 2012 18:41

Thank you info

I got the error messages from the gui.
I typed

l = Orange.classification.tree.C45Learner()

encouragingly got no error messages.

is there a difference between import Orange and import orange

Ideally I would like to run from the gui anthony

Re: OWC45Tree error

Postby aw101 » Thu Apr 19, 2012 18:44

on windows platform 32 bit.

should there be a library called c45.pyd one of the python scripts suggests this might be so.

is there a difference between c45.pyd or c45.dll. I cannot locate a file called c45.pyd.

the buildc45.py script just appears to call the compiler, compile ensemble.c produce c45.dll, ext , lib and copy them over to the orange directory.

do I need to do anything else to build the plug in

Anthony

Re: OWC45Tree error

Postby marko » Thu Apr 19, 2012 20:44

Maybe there is a bug with widget's detection of C45 on your platform (it works for me on linux).

Could you please try commenting out or deleting lines 23-33 in Orange/OrangeWidgets/Classify/OWC45Tree.py (that part prevents the widget to load if it does not detect C45, but this should not be a problem as you showed that it works in scripting mode)?

As for "Orange" vs "orange": Orange is transitioning from old "orange" + "orng" modules namespace into common namespace for both: "Orange". "orange" is only left for backward compatibility.

Thanks,
Marko

Re: OWC45Tree error

Postby aw101 » Fri Apr 20, 2012 20:02

Hi there gave it a try all it did was remove OWC45Tree from the list below.

Anthony

There were problems importing the following widgets:
OWC45Tree: c45 is not found
OWItemsetViz: No module named OWNetworkCanvas
OWModelMap: No module named scipy.stats
OWRScript: No module named r
OWPLS: No module named optimization
OWModelMapQt: No module named scipy.stats
OWLinProj3D: No module named OpenGL
OWNxExplorer3D: No module named OWNxExplorerQt
OWScatterPlot3D: No module named OpenGL
OWSphereviz3D: No module named OpenGL
The following widgets could not be imported and will not be available: OWSphereviz3D, OWC45Tree, OWModelMapQt, OWLinProj3D, OWNxExplorer3D, OWPLS, OWScatterPlot3D.
The following prototype widgets could not be imported and will not be available: OWRScript, OWModelMap, OWItemsetViz.

Re: OWC45Tree error

Postby marko » Fri Apr 20, 2012 21:58

Ok, but do you perhaps see the C4.5 widget in the classification pane now? Does it work?

Re: OWC45Tree error

Postby aw101 » Mon Apr 23, 2012 23:43

The widget does n't appear. close but no cigar.

out of desparation built ubuntu machine. used apt to get the developer dependancies

Can see the C45 widget, complains that c45.dll is missing !

tried to compile the src as per buildC45.py

got the following error message.

ensemble.c: In function ‘guarded_alloc’:
ensemble.c:78: warning: incompatible implicit declaration of built-in function ‘malloc’
ensemble.c:84: warning: incompatible implicit declaration of built-in function ‘realloc’
ensemble.c:90: warning: incompatible implicit declaration of built-in function ‘calloc’
ensemble.c:90: warning: incompatible implicit declaration of built-in function ‘malloc’
ensemble.c: In function ‘guarded_free’:
ensemble.c:116: warning: incompatible implicit declaration of built-in function ‘free’
ensemble.c: In function ‘guarded_collect’:
ensemble.c:125: warning: incompatible implicit declaration of built-in function ‘free’
In file included from ensemble.c:160:
prune.c: In function ‘Prune’:
prune.c:58: warning: incompatible implicit declaration of built-in function ‘memset’
prune.c: In function ‘EstimateErrors’:
prune.c:123: warning: incompatible implicit declaration of built-in function ‘memcpy’
prune.c:235: warning: incompatible implicit declaration of built-in function ‘memcpy’
prune.c: In function ‘CheckPossibleValues’:
prune.c:289: warning: incompatible implicit declaration of built-in function ‘memcpy’
In file included from ensemble.c:164:
subset.c: In function ‘EvalSubset’:
subset.c:86: warning: incompatible implicit declaration of built-in function ‘memset’
subset.c:282: warning: incompatible implicit declaration of built-in function ‘memcpy’
subset.c: In function ‘SubsetTest’:
subset.c:417: warning: incompatible implicit declaration of built-in function ‘memcpy’
In file included from ensemble.c:165:
trees.c: In function ‘ShowBranch’:
trees.c:191: warning: incompatible implicit declaration of built-in function ‘strlen’
trees.c: In function ‘MaxLine’:
trees.c:243: warning: incompatible implicit declaration of built-in function ‘strlen’
trees.c:256: warning: incompatible implicit declaration of built-in function ‘strlen’
trees.c: In function ‘SaveTree’:
trees.c:298: warning: incompatible implicit declaration of built-in function ‘strcpy’
trees.c:299: warning: incompatible implicit declaration of built-in function ‘strcat’
trees.c: In function ‘GetTree’:
trees.c:386: warning: incompatible implicit declaration of built-in function ‘strcpy’
trees.c:387: warning: incompatible implicit declaration of built-in function ‘strcat’
trees.c: In function ‘Leaf’:
trees.c:545: warning: incompatible implicit declaration of built-in function ‘memcpy’
trees.c: In function ‘CopyTree’:
trees.c:618: warning: incompatible implicit declaration of built-in function ‘memcpy’
trees.c: In function ‘SaveDiscreteNames’:
trees.c:659: warning: incompatible implicit declaration of built-in function ‘strlen’

The orange classifier works. The preprocess widget does n't function red ?.

Anthony

Re: OWC45Tree error

Postby aw101 » Mon Apr 23, 2012 23:46

I get a smaller error message from the process widget

There were problems importing the following widgets:
OWScatterPlot3D: cannot import name QtOpenGL
OWRScript: No module named rpy2.robjects
OWMetaMiner: No module named scipy.stats
The following prototype widgets could not be imported and will not be available: OWMetaMiner, OWScatterPlot3D, OWRScript.

Unhandled exception of type KeyboardInterrupt occured at 15:42:31:
Traceback:
File: OWBaseWidget.py, line 664 in processSignals
Code: handler(value)
File: OWLogisticRegression.py, line 125 in setData
Code: self.applyData()
File: OWLogisticRegression.py, line 110 in applyData
Code: classifier = self.learner(self.data)
File: orngLR.py, line 79 in __call__
Code: lr = learner.fitModel(examples, weight)
KeyboardInterrupt

Re: OWC45Tree error

Postby aw101 » Tue Apr 24, 2012 0:27

noticed there are dependancies on R for Py and also scipy

List is getting smaller.

Re: OWC45Tree error

Postby aw101 » Tue Apr 24, 2012 0:56

Appears to be only two issues left

the processor widget calling some openGl libraries

There were problems importing the following widgets:
OWScatterPlot3D: cannot import name entrypoint31
The following prototype widgets could not be imported and will not be available: OWScatterPlot3D.

Unhandled exception of type KernelException occured at 16:58:24:
Traceback:
File: orngSignalManager.py, line 551 in processNewSignals
Code: self.widgets[i].processSignals()
File: OWBaseWidget.py, line 676 in processSignals
Code: self.handleNewSignals()
File: OWPreprocess.py, line 834 in handleNewSignals
Code: self.commit()
File: OWPreprocess.py, line 952 in commit
Code: data = wrap.processData(self.data)
File: orngWrap.py, line 240 in processData
Code: t = preprocessor(data, weightId) if hasWeight else preprocessor(data)
File: OWPreprocess.py, line 75 in __call__
Code: newattr = self.method(attr, data)
KernelException: 'orange.DiscDistribution': invalid value


And the c45.dll

Anthony


Return to Questions & Support