Orange Forum • View topic - Prototype Random Forest widget does not predict

Prototype Random Forest widget does not predict

Report bugs (or imagined bugs).
(Archived/read-only, please use our ticketing system for reporting bugs and their discussion.)
Forum rules
Archived/read-only, please use our ticketing system for reporting bugs and their discussion.

Prototype Random Forest widget does not predict

Postby vnams » Tue Jul 10, 2007 1:45

First, thanks for pointing out the prototype wigdets. I can get the Random Forest widget to give a result in the Test Learneres widget. But it doesn't give predictions.

The predictions widget does not show a prediction, but it does show the data, and I also get the following error message:

Unhandled exception of type occured at 21:31:21:
Traceback:
File: OWBaseWidget.py in line 518
Function name: processSignals
Code: handler(value, (widgetFrom, nameFrom, id))
File: OWPredictions.py in line 311
Function name: setClassifier
Code: self.outvar = c.classVar
Exception type:
Exception value: classVar

Postby marko » Tue Jul 10, 2007 9:15

Villis,

I would like to thank you for reporting the bug. Users like you really help us making Orange better.

Your problem is fixed now. As Orange snapshots are built daily, the fix will appear in tomorrow's snapshot as the latest.

For a quick fix, you can download the fixed file itself (http://www2.arnes.si/~sodmtopl/orange/orngEnsemble.py) and copy it over the old version of that file. The file is usually located in "c:\Python25\Lib\site-packages\orange" folder (Python version may differ).

Marko

Postby vnams » Wed Jul 11, 2007 1:39

I installed the revised version of the random forest widget. This time after I connect the predictions widget I get no error messages. But I get nothing in the data view of the predictions widget - not only no predictions, but no original data (which previously had been). However I get no error messages.
If I connect the widget to the Table widget, it is empty.
But when I click on click "send data" in the predictcions widget then I get the following error:

Unhandled exception of type occured at 21:31:29:
Traceback:
File: orngSignalManager.py in line 60
Function name: __call__
Code: self.method(*k)
File: OWPredictions.py in line 354
Function name: senddata
Code: self.selection()
File: OWPredictions.py in line 414
Function name: selection
Code: s = [cmpclasses(cls) for cls in self.classifications]
Exception type:
Exception value: classifications

Vilis

Postby marko » Wed Jul 11, 2007 9:23

Villis,

I could replicate the reported exception only if I "forgot" to connect "File" to "Predictions" widget. Is it possible that you made the same error?

The documentation for the "Predictions" widget seems not to exist. Therefore I will briefly explain it's use. For the "Predistions" widget to work it has to have two connections to the outside world: one connection for the classifier and another for the data to make predictions on. After connection the "Predictions" widget correctly you can double click on it and behold, predictions galore.

The first image illustrates simplest possible way to see "Predictions" widget working. But you don't want to do such thing on your research data: this is predicting the things you already know.

Image

The second image shows "correct" use of the Predictions widget. Classifier is build on examples with known classes. Then other examples can be predicted.

Image

Marko

PS: I did find another bug in orngEnsemble, but it was not related to your problem. The changed file is on the same address as yesterday's fix.

Postby Guest » Thu Jul 12, 2007 2:52

Oops, you're right. I feel very silly, especially since I previously had the Predictions widget connected correctly to the Bayes classifier. But I am slowly progressing.

I can now get predictions from the Random Forest Classifier. However the left panel of the Predictions widget is greyed out, and I get the following error message:


Unhandled exception of type occured at 22:34:45:
Traceback:
File: OWBaseWidget.py in line 518
Function name: processSignals
Code: handler(value, (widgetFrom, nameFrom, id))
File: OWPredictions.py in line 336
Function name: setClassifier
Code: self.checksenddata()
File: OWPredictions.py in line 344
Function name: checksenddata
Code: if len(self.classifiers) and self.sendOnChange: self.senddata()
File: OWPredictions.py in line 353
Function name: senddata
Code: self.predictions()
File: OWPredictions.py in line 393
Function name: predictions
Code: predictions = orange.ExampleTable(domain, self.data)
File: OWPredictions.py in line 375
Function name:
Code: getValueFrom = lambda ex, rw, cindx=i: orange.Value(c(ex,
c.GetProbabilities)[cindx])) \
Exception type:
Exception value: GetProbabilities

Also I am trying to save predictions to a file. I'm not sure if this problem is related to the above, but when I connect the Predictions Widget to a Save widget then nothing is saved.

Thanks, Vilis

Postby marko » Fri Jul 13, 2007 7:14

Well, that unrelated bug wasn't so unrelated afterall (I mentioned it in postscript of my last message).

For a quick fix, you can download the fixed file itself (http://www2.arnes.si/~sodmtopl/orange/orngEnsemble.py) and copy it over the old version of that file. The file is usually located in "c:\Python25\Lib\site-packages\orange" folder (Python version may differ).

You can also install a new snapshot.

Marko

Postby Blaz » Sun Sep 16, 2007 8:54

I have now moved the widget to Classification pane (removing the widget in Prototypes).


Return to Bugs