Add topological order to Network

This commit is contained in:
2023-08-02 00:56:52 +02:00
parent f63a9a64f9
commit cdfb45d2cb
7 changed files with 58 additions and 0 deletions

View File

@@ -158,6 +158,7 @@ int main(int argc, char** argv)
states[feature] = vector<int>(maxes[feature]);
}
states[className] = vector<int>(maxes[className]);
auto clf = platform::Models::instance()->create(model_name);
clf->fit(Xd, y, features, className, states);
auto score = clf->score(Xd, y);
@@ -166,6 +167,11 @@ int main(int argc, char** argv)
for (auto line : lines) {
cout << line << endl;
}
cout << "--- Topological Order ---" << endl;
for (auto name : clf->topological_order()) {
cout << name << ", ";
}
cout << "end." << endl;
cout << "Score: " << score << endl;
auto dot_file = model_name + "_" + file_name;
ofstream file(dot_file + ".dot");