creating categorical from continuous variable in Orange

creating categorical from continuous variable in Orange

by Daniel Soulsby -
Number of replies: 0

Q: 
I am trying to create a new variable for my project using the NHANES dataset.  What I'm trying to accomplish is to create a new variable for high sugar intake (using prior variable, predsug, defined by >/=25g = 1 and <25g =0).  I tried using the Feature Constructor widget similar to Lab 1 but I think I'm having trouble writing the correct algorithm (tried = 1 if predsug >=25 and 0 if predsug <25).  I've tried a few variations but Orange isn't recognizing my syntax. 

Is the correct widget to use to accomplish something like this?  Any tips for the algorithm?

A:
Try "1 if predsug > 25 else 0"

This was helpful to me - may be helpful to others too!

-Danny