Fix mistakes in feature selection in SPnDE

Complete the first A2DE test
Update version number
This commit is contained in:
2024-05-05 11:14:01 +02:00
parent f806015b29
commit 0ec53f405f
7 changed files with 18 additions and 15 deletions

View File

@@ -16,7 +16,7 @@ namespace bayesnet {
addNodes();
std::vector<int> attributes;
for (int i = 0; i < static_cast<int>(features.size()); ++i) {
if (std::find(parents.begin(), parents.end(), i) != parents.end()) {
if (std::find(parents.begin(), parents.end(), i) == parents.end()) {
attributes.push_back(i);
}
}
@@ -25,6 +25,7 @@ namespace bayesnet {
for (const auto& attribute : attributes) {
model.addEdge(className, features[attribute]);
for (const auto& root : parents) {
model.addEdge(features[root], features[attribute]);
}
}