Convert datetime attribute(time) to morning, afternoon,evening,night
Hi all,
I was trying to convert time into morning afternoon,evening and night, and using Discretize by User Specification but it's not helping me out.
Can someone help me in doing the process in Generate atribute operator?
In my project it is..
Morning- 6am to 11am
Afternoon- 11am - 4pm
Evening- 4pm- 11pm
Regards,
Gohel
I was trying to convert time into morning afternoon,evening and night, and using Discretize by User Specification but it's not helping me out.
Can someone help me in doing the process in Generate atribute operator?
In my project it is..
Morning- 6am to 11am
Afternoon- 11am - 4pm
Evening- 4pm- 11pm
Regards,
Gohel
Find more posts tagged with
Sort by:
1 - 2 of
21
You actually can use Discretize by User Specification, you simply need to create a separate group for the 0-6 values and classify it as "Night" as well as a group for the 23+ values (also classified as "Night"). Meaning you can map different non-contiguous values to the same outcome with this operator.
You can use recursive if else block in generate attributes to take care of this as your limits are consistent for "Night".
Example XML Code as follows: