Commit 819db148 authored by Thomas Purcell's avatar Thomas Purcell
Browse files

Update Tests for New Python Feature Exclusion

Tests failed becausssse off  this
parent d4a21af1
......@@ -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);
......
......@@ -56,6 +56,11 @@ namespace
EXPECT_THROW(str2node::postfix2node("0|asdf", _phi0, _feat_ind, excluded_inds), std::logic_error);
EXPECT_THROW(str2node::postfix2node("1|0|sq", _phi0, _feat_ind, excluded_inds), std::logic_error);
EXPECT_THROW(str2node::postfix2node("3|sq", _phi0, _feat_ind, excluded_inds), std::logic_error);
excluded_inds = {1};
EXPECT_THROW(str2node::postfix2node("1|sq", _phi0, _feat_ind, excluded_inds), InvalidFeatureException);
excluded_inds.clear();
node_ptr test = str2node::postfix2node("0|2|div|exp|1|add", _phi0, _feat_ind, excluded_inds);
EXPECT_EQ(test->type(), NODE_TYPE::ADD);
......
......@@ -45,7 +45,7 @@ def test_gen_feature_space_from_file():
prop = np.power(phi_0[0].value + phi_0[1].value, 2.0)
feat_space = FeatureSpace(
f"{parent}/phi.txt", phi_0, prop, task_sizes_train, "regression", 1, 1.0
f"{parent}/phi.txt", phi_0, prop, task_sizes_train, "regression", 1, 1.0, []
)
feat_space.sis(prop)
assert feat_space.phi_selected[0].postfix_expr == "1|0|add|sq"
......
......@@ -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"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment