Orange Forum • View topic - scaling of ExampleTable ?

scaling of ExampleTable ?

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

scaling of ExampleTable ?

Postby Uwe Schmitt » Thu Aug 14, 2008 15:29

I would like to scale an ExamplTable to the range [0,1]. Is there a function in orange to do this ? It is crucial for the performance of svm classifiers.

Greetings, uwe

Re: scaling of ExampleTable ?

Postby Guest » Thu Aug 14, 2008 15:40

Uwe Schmitt wrote:I would like to scale an ExampleTable to the range [0,1]. Is there a function in orange to do this ? It is crucial for the performance of svm classifiers.

Greetings, uwe


More precise: I want to scale one or more Attributes, not the whole table at once.

Greetings, Uwe

Postby Janez » Mon Aug 25, 2008 21:03

Hi, Uwe,

there is ... sort of. It will scale all attributes, not just a single one, and it will also convert discrete attributes into one or more dummy continuous attributes.

The class is called DomainContinuizer (it served a slightly different purpose initially, we kept the name for compatibility). You can find somewhat outdated documentation at http://www.ailab.si/orange/doc/referenc ... mValue.htm.

Here's, basically, how you do it.

Code: Select all
import orange
t=orange.DomainContinuizer()
t.continuousTreatment = orange.DomainContinuizer.NormalizeBySpan
t.classTreatment = orange.DomainContinuizer.Ignore

d = orange.ExampleTable("iris")
dom = t(d)
d2 = orange.ExampleTable(dom, d)


I had to set classTreatment to Ignore since the class in "Iris" is discrete with three values and cannot be converted into two or three dummy variables (orange does not allow more than one dependent variable).

The continuizer does not return a scaled data but a domain description with attributes that are scaled versions of the original attributes (using the span of their values in the original data). To do the scaling, you then construct a new example table from the old one with the new domain, as the last line does.


Return to Questions & Support