Data science

There is probably a _cleaner_ way to do this using `group_by`. First group the data in `grouped = @data.group_by { |result| result["cohort"] }.to_a` and then build cohorts `grouped.map { |group| Cohort.new(group[1], group[0]) }`. Either way your code is readable enough the way it is.