Orange Forum • View topic - orngEnsemble.RandomForestLearner creating error

orngEnsemble.RandomForestLearner creating error

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

orngEnsemble.RandomForestLearner creating error

Postby rgiuly » Thu Jun 28, 2012 1:02

Hi, I have some code that has worked before with older versions of orange, but appears to have a problem now. I've just installed the new orange snapshot (the older archived versions ones were giving build errors) on a new computer and I'm getting this error. Any suggestion on how to fix? I looked in the documentation for a change but didn't find any.

version: ...
OS version: ubuntu 12.4

Here's the problem line (1040):
forest = orngEnsemble.RandomForestLearner(data, self.numberOfTrees,
name="forest", learner=tree)

Here's the error:

Traceback (most recent call last):
File "", line 338, in <module>
File "", line 78, in voxelStep
File "../", line 51, in batchProcessVoxels
File "../", line 129, in runSteps
File "../", line 92, in run
File "../", line 1845, in runClassifyVoxels
File "../", line 839, in classifyVoxels
File "../", line 1040, in classifyVoxels
name="forest", learner=tree)
TypeError: _orange__new_wrapped() takes at most 2 arguments (5 given)


Re: orngEnsemble.RandomForestLearner creating error

Postby Ales » Thu Jun 28, 2012 10:31

You need to pass the 'self.numberOfTrees' argument as a keyword.
Code: Select all
forest = orngEnsemble.RandomForestLearner(data, trees=self.numberOfTrees,
name="forest", learner=tree)

Re: orngEnsemble.RandomForestLearner creating error

Postby rgiuly » Fri Jun 29, 2012 0:39

Hi Ales,
Ah OK, thanks. I appreciate it.


Return to Questions & Support