Orange Forum • View topic - new feature

new feature

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

new feature

Postby Jony » Thu Sep 12, 2013 15:14

hi,

I want to create a new feature or attribute which is mean/average of two other attributes. I am trying using feature construction node, but it does not have any mean or average function. how to do it then?

Re: new feature

Postby Ales » Fri Sep 13, 2013 11:00

Jony wrote:I want to create a new feature or attribute which is mean/average of two other attributes. I am trying using feature construction node, but it does not have any mean or average function. how to do it then?

For instance, you could use
Code: Select all
("sepal length" + "sepal width") / 2.0

Re: new feature

Postby Jony » Fri Sep 13, 2013 16:54

hi,

are you saying putting ("sepal length" + "sepal width") / 2.0 in the feature constructor? i have tried it, but the output is only ? marks. is it a valid expression in feature constructor widget?

Re: new feature

Postby Ales » Mon Sep 16, 2013 9:57

Jony wrote:are you saying putting ("sepal length" + "sepal width") / 2.0 in the feature constructor? i have tried it, but the output is only ? marks. is it a valid expression in feature constructor widget?

Yes (on the 'iris' dataset).

Re: new feature

Postby Jony » Mon Sep 16, 2013 11:10

hi, for this do the both need to be continuous or discrete? my both attributes contain real numbers, but one of them are discrete and another is continuous. If both of them needs to be continuous then how can i make the discrete one to continuous?

Re: new feature

Postby Ales » Wed Sep 18, 2013 9:57

Jony wrote:hi, for this do the both need to be continuous or discrete?
Continuous (at least in this case)
Jony wrote:my both attributes contain real numbers, but one of them are discrete and another is continuous. If both of them needs to be continuous then how can i make the discrete one to continuous?

Do you mean you have a discrete attribute with values ['0.1', '0.2'] (for instance). Why not just make it continuous to start with (mark it as such in the tab file)?

However you might try this
Code: Select all
("attr_cont" + float(str("attr_disc"))) / 2.0

Re: new feature

Postby Jony » Tue Oct 08, 2013 18:55

hi,

I want to combine two conditions together.

like p1==1 or p2==1 in feature construction. it can read p1==1 but how to implement that "or" portion?


Return to Questions & Support



cron