diff --git a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/div/divide.cpp b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/div/divide.cpp index 9b3dbac3b8d9ab3168fac7aa57267e2d81ebe091..9a9177aa6c428650dad38828f10d8ccd34bc32cf 100644 --- a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/div/divide.cpp +++ b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/div/divide.cpp @@ -63,7 +63,7 @@ void generateDivNode(std::vector<node_ptr>& feat_list, const node_ptr feat_1, co double div_mult_tot_first = div_mult_leaves.begin()->second; if( (std::abs(div_mult_tot_first) != 1.0) && - std::all_of(div_mult_leaves.begin(), div_mult_leaves.end(), [&div_mult_tot_first](auto el){return el.second == div_mult_tot_first;}) + std::all_of(div_mult_leaves.begin(), div_mult_leaves.end(), [&div_mult_tot_first](auto el){return std::abs(el.second) == div_mult_tot_first;}) ) { return; diff --git a/tests/googletest/feature_creation/feature_space/test_feat_space.cc b/tests/googletest/feature_creation/feature_space/test_feat_space.cc index 7fc4b67a91926f837789f5b63735cfadb2870114..87d3212e0f075ea297bac43df30fa357197e3898 100644 --- a/tests/googletest/feature_creation/feature_space/test_feat_space.cc +++ b/tests/googletest/feature_creation/feature_space/test_feat_space.cc @@ -107,7 +107,7 @@ namespace EXPECT_EQ(feat_space.max_rung(), 2); EXPECT_EQ(feat_space.n_sis_select(), 10); EXPECT_EQ(feat_space.n_samp_train(), 10); - EXPECT_EQ(feat_space.n_feat(), 154); + EXPECT_EQ(feat_space.n_feat(), 148); EXPECT_EQ(feat_space.n_rung_store(), 1); EXPECT_EQ(feat_space.n_rung_generate(), 0); @@ -165,7 +165,7 @@ namespace EXPECT_EQ(feat_space.max_rung(), 2); EXPECT_EQ(feat_space.n_sis_select(), 10); EXPECT_EQ(feat_space.n_samp_train(), 10); - EXPECT_EQ(feat_space.n_feat(), 154); + EXPECT_EQ(feat_space.n_feat(), 148); EXPECT_EQ(feat_space.n_rung_store(), 1); EXPECT_EQ(feat_space.n_rung_generate(), 0); @@ -193,7 +193,7 @@ namespace EXPECT_EQ(feat_space.max_rung(), 2); EXPECT_EQ(feat_space.n_sis_select(), 10); EXPECT_EQ(feat_space.n_samp_train(), 10); - EXPECT_EQ(feat_space.n_feat(), 154); + EXPECT_EQ(feat_space.n_feat(), 148); EXPECT_EQ(feat_space.n_rung_store(), 1); EXPECT_EQ(feat_space.n_rung_generate(), 0); diff --git a/tests/pytest/test_feature_creation/test_feature_space/test_gen_feature_space_selected_from_file.py b/tests/pytest/test_feature_creation/test_feature_space/test_gen_feature_space_selected_from_file.py index 6ed153a65b0f16ea13a7c7abac7be6ddf84e982b..cda96a5a3ecfcc27ed065aa735124e998b2be769 100644 --- a/tests/pytest/test_feature_creation/test_feature_space/test_gen_feature_space_selected_from_file.py +++ b/tests/pytest/test_feature_creation/test_feature_space/test_gen_feature_space_selected_from_file.py @@ -25,7 +25,7 @@ def test_gen_feature_space_from_file(): inputs = read_csv(str(parent / "data.csv"), "Prop", task_key="Task", max_rung=2) phi_sel = phi_selected_from_file( - str(parent / "selected_features.txt"), inputs.phi_0 + str(parent / "selected_features.txt"), inputs.phi_0, [] ) assert phi_sel[0].postfix_expr == "3|2|add|3|abs|add"