def test_row(self, row):
     """
     Return the score for the k-context of a single event
     """
     result = Result.Event_result(row.Index)  #, getattr(row, "anom_types"))
     for (key, value) in self.iterate_current_variables():
         result.set_attribute_score(value.attr_name, value.test(row))
     return result
 def test(self, data):
     """
     Compute the scores for all events in the data
     :param data:
     :return:
     """
     ranking = []
     for row in data.itertuples():
         result = Result.Trace_result(row.Index)
         result.add_event(self.test_row(row))
         ranking.append(result)
     return ranking
 def test_trace(self, trace):
     result = Result.Trace_result(trace[0])
     for row in trace[1].itertuples():
         result.add_event(self.test_row(row))
     return result