Orange Forum • View topic - Use feature constructor widget to output discrete values?

Use feature constructor widget to output discrete values?

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

Use feature constructor widget to output discrete values?

Postby PenguinJunk » Fri Apr 19, 2013 15:25

I'm loving visual Orange, its so useful for dabbling and getting a broad overview of my data.

One snag, I want to discretize one of my attributes. I have constructed the new attribute:

ErrorClass:=abs(Meas-Pred)>1

The output from this is ostensibly continuous (1.000, 0.000, ..., 1.000) but I want to use it for classification.

I've tried discretizing this using the discretize widget but get weird results (>0.5, <0.5, ..., >0.5) and sometimes no results at all and my classifiers won't accept it as a class attribute.

I've tried conditional statements e.g. various versions of:

ErrorClass:=if(abs(Mease-Pred)>1,Bad,Good)

My question is what is my best method for creating this discrete attribute from continuous attributes? Is there a way of getting a bool out of feature constructor? Or out of discretize? Or can I force a continuous attribute to be treated as a class attribute by my learners (I've made sure that it is specified as the Class in Select Attributes)?

Re: Use feature constructor widget to output discrete values

Postby Ales » Fri Apr 19, 2013 16:03

Unfortunately the "Feature Constructor" widget can only create continuous attributes.

But you can use the 'Discretize' widget to set a custom fixed interval discretization. Select the "Explore and set individual discretizations" in the "Individual attribute treatment" box. Then select the newly constructed attribute from the list, select the "Custom 1" option next to it and simply input the interval cut points (e.g. 0.5). This should create a fixed discretization into (<=0.5, >0.5) values.

You can also rename the values for the attribute later using the "Edit Domain" widget.

Re: Use feature constructor widget to output discrete values

Postby jasonzutty » Thu Aug 29, 2013 18:08

Did something happen to the Discretize widget?

I did a fresh clone, build, and install from the repo, and I don't seem to have the discretize widget.

Thanks,
Jason

Re: Use feature constructor widget to output discrete values

Postby Ales » Fri Aug 30, 2013 11:10

jasonzutty wrote:I did a fresh clone, build, and install from the repo, and I don't seem to have the discretize widget.
Do you have PyQwt5 installed?

Re: Use feature constructor widget to output discrete values

Postby jasonzutty » Fri Aug 30, 2013 14:39

Yes:

Reading package lists... Done
Building dependency tree
Reading state information... Done
python-qwt5-qt4 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

Re: Use feature constructor widget to output discrete values

Postby Ales » Mon Sep 02, 2013 15:53

Can you please run Canvas from the command line using the '-l3' switch, i.e.
Code: Select all
orange-canvas -l4
and look for any errors reported for a '.../OrangeWidgets/Data/OWDiscretize.py' file.

Re: Use feature constructor widget to output discrete values

Postby jasonzutty » Tue Sep 03, 2013 17:54

ImportError: cannot import name orangeqt

I get that a lot.


Return to Questions & Support