def test_pickling_sklearn(self, sklearn_model: SKLearnModel): fp = BytesIO() pickle.dump(sklearn_model, fp) fp.flush() fp.seek(0) actual_model = pickle.load(fp) assert_models_equal(sklearn_model, actual_model, pickled=True)
def test_pickling_pygam(self, pygam_model: GAM): fp = BytesIO() pickle.dump(pygam_model, fp) fp.flush() fp.seek(0) actual_model = pickle.load(fp) assert_models_equal(pygam_model, actual_model, pickled=True)
def test_pickling(self, gamr_model: GAMR): fp = BytesIO() pickle.dump(gamr_model, fp) fp.flush() fp.seek(0) actual_model = pickle.load(fp) assert_models_equal(gamr_model, actual_model, pickled=True)
def test_deep_copy_pygam(self, pygam_model: GAM): assert_models_equal(pygam_model, deepcopy(pygam_model), deepcopy=True)
def test_shallow_copy_pygam(self, pygam_model: GAM): assert_models_equal(pygam_model, copy(pygam_model), deepcopy=False)
def test_deep_copy_sklearn(self, sklearn_model: SKLearnModel): assert_models_equal(sklearn_model, deepcopy(sklearn_model), deepcopy=True)
def test_shallow_copy_sklearn(self, sklearn_model: SKLearnModel): assert_models_equal(sklearn_model, copy(sklearn_model), deepcopy=False)
def test_deep_copy(self, gamr_model: GAMR): assert_models_equal(gamr_model, deepcopy(gamr_model), deepcopy=True)
def test_shallow_copy(self, gamr_model: GAMR): assert_models_equal(gamr_model, copy(gamr_model), deepcopy=False)