perhaps `nomalize_factor = len(self.predictions)` outside the loop would be clearer.