rewrite accuracy metrics to use pandas framework