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: http://orange.biolab.si/download/orange ... -06-27.zip
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 "run_pipeline_test.py", line 338, in <module>
voxelStep('classifyVoxels')
File "run_pipeline_test.py", line 78, in voxelStep
voxelChunkSize)
File "../batch_process.py", line 51, in batchProcessVoxels
runSteps(**segmentationParams)
File "../run_steps.py", line 129, in runSteps
detector.run(steps)
File "../segmentation_manager.py", line 92, in run
self.componentDetector.runClassifyVoxels()
File "../component_detector.py", line 1845, in runClassifyVoxels
numberOfLayersToProcess=self.numberOfLayersToProcess)
File "../component_detector.py", line 839, in classifyVoxels
inputImageNodePath)
File "../cytoseg_classify.py", line 1040, in classifyVoxels
name="forest", learner=tree)
TypeError: _orange__new_wrapped() takes at most 2 arguments (5 given)
rgiuly@cytorg:~/eclipse_workspace/SLASH/imageprocessing/cytoseg/testing$


Thanks
-Rick

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.

-Rick


Return to Questions & Support



cron