From 7e8e84e16c4f92415330aa819e17123ac24e12fa Mon Sep 17 00:00:00 2001 From: ppdebreuck Date: Thu, 28 Mar 2024 11:42:31 +0100 Subject: [PATCH] add crossover test --- modnet/tests/test_hyper_opt.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modnet/tests/test_hyper_opt.py b/modnet/tests/test_hyper_opt.py index dc117b7..021a71b 100644 --- a/modnet/tests/test_hyper_opt.py +++ b/modnet/tests/test_hyper_opt.py @@ -29,3 +29,11 @@ def test_ga(small_moddata, tf_session): assert type(model) is EnsembleMODNetModel assert len(model.models) == 1 + + +def test_crossover(): + from modnet.hyper_opt.fit_genetic import Individual + + indiv1 = Individual(max_feat=50, num_classes={}, multi_label=False) + indiv2 = Individual(max_feat=50, num_classes={}, multi_label=False) + indiv1.crossover(indiv2)