コード例 #1
0
    def test_load(self):
        kernel = Covariance(RBF(1) * RBF(1) + RationalQuadratic(1))
        gp_model = GPModel(kernel)

        file_name = "test_save"
        out_file_name = gp_model.save(file_name)

        self.addCleanup(os.remove, out_file_name)

        new_gp_model = GPModel.load(out_file_name)

        self.assertIsInstance(new_gp_model, GPModel)
        self.assertEqual(gp_model.covariance.infix, new_gp_model.covariance.infix)
コード例 #2
0
 def load_best_model(self) -> GPModel:
     return GPModel.load(self.best_model_filename)