Fixed memory leak in Predictor by adding self.f.