Something went wrong. Try again.
❄️ The Icicle Streaming Query Language ❄️
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192module Default whereimport Missingimport Demographicsinput injury : { action : Option String , location : String , severity : Double }is_head : String -> Boolis_head l = l == "head"max_group : Element b -> Aggregate a -> Aggregate (Possibly b)max_group k e = group fold (k, e) = (group k in e) in max_by e kfeature actioned_damage = from injury in filter let Some act = action in group act in sum severityfeature age = from age in newest valuefeature is_head = from injury in is_head (newest location)feature any_head = from injury in any (is_head location)feature sum_severity = from injury in sum severityfeature any_ea = from injury in any (grepl "ea" location)feature empty = from injury in seq missing 0feature head_damage = from injury in filter is_head location in sum severityfeature worst_injured = from injury in max_group location (sum severity)feature most_injured = from injury in max_group location (count severity)feature sd_injury = from injury in sd severityfeature mean_injury = from injury in mean severityfeature injury_blah = from injury in filter location == "head" || (location == "arm" && is_some action) in sum severityfeature mean_day_of_week = from injury in let tau = 2 * pi dow = tau / 7 * double (mod (days time) 7) m = (circular_stats dow).mean in m / tau * 7feature days_in_location = from injury in days_in location time now