Orange Forum • View topic - orngSOM.SOMSupervisedLearner and Orange.FloatVariable

orngSOM.SOMSupervisedLearner and Orange.FloatVariable

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

orngSOM.SOMSupervisedLearner and Orange.FloatVariable

Postby mcormier » Tue Feb 14, 2012 11:19

Hi,

I am using the Orange library to make an application. In this application I am using the orngSOM module to use the SOMLearner and SOMSupervisedLearner class. To use those classes, I create a domain of Orange.FloatVariable, since my data are floats, and create an ExampleTable.

When I call the SOMLearner algorithm, everything works great and I can obtain a good SOM map.
When I call the SOMSupervisedLearner I get the following error:

AttributeError: 'orange.FloatVariable' has no attribute 'values'

The error seems to come from the following line, in the __call__ function of the SOMSupervisedLearner class:

Code: Select all
nval = len(examples.domain.classVar.values)


Does the SOMSupervisedLearner not work with the FloatVariable type?
If yes that would be troublesome.

I tried to use the EnumVariable class, the error doesn't show up but the map is pretty bad and the data doesn't seem to be sorted the way the SOM algorithm should do. I got this same problem with the SOMLearner and EnumVariable.

Is there a way to go past this FloatVariable issue?

I can post some code if necessary.

Thank you.

Re: orngSOM.SOMSupervisedLearner and Orange.FloatVariable

Postby marko » Tue Feb 14, 2012 14:03

Only the class variable should be of type EnumVariable.

Re: orngSOM.SOMSupervisedLearner and Orange.FloatVariable

Postby mcormier » Wed Feb 15, 2012 10:34

I will try that and will let you know if I succeeded.

Thank you for your help.

Re: orngSOM.SOMSupervisedLearner and Orange.FloatVariable

Postby mcormier » Wed Feb 15, 2012 13:03

It worked.
Thank you again for your help.


Return to Questions & Support