sethah commented on issue #9777: Mx 9588
   Regarding other approaches, something I looked at was the following:
   class MacroMetric(EvalMetric):
       def __init__(self, base_metric):
           super(MacroMetric, self).__init__("macro_" +, 
           self.base_metric = base_metric
       def update(self, labels, preds):
           self.base_metric.update(labels, preds)
           self.sum_metric += self.base_metric.get()[1]
           self.num_inst += 1
   Any metric that has defined the "micro" behavior can then be used as "macro" 
just by calling `metric = mx.metric.MacroMetric(mx.metric.F1())`, but that 
seems pretty awkward for the users, and also changes the default behavior to 
micro, which doesn't work for backwards compatibility. The current solution 
works well enough, and we could probably revisit in a later PR if needed.

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

Reply via email to