Add comments to .net files

This commit is contained in:
Ricardo Montañana Gómez 2023-07-02 00:48:24 +02:00
parent 23f0b0f55c
commit 83080e2b56
Signed by: rmontanana
GPG Key ID: 46064262FD9A7ADE
2 changed files with 10 additions and 7 deletions

View File

@ -1,5 +1,5 @@
class sepallength class sepallength
class sepalwidth class sepalwidth
class petallength class petallength
class petalwidth class petalwidth
petalwidth petallength # petalwidth petallength

View File

@ -174,6 +174,9 @@ void build_network(bayesnet::Network& network, string network_name, map<string,
ifstream file(network_name); ifstream file(network_name);
string line; string line;
while (getline(file, line)) { while (getline(file, line)) {
if (line[0] == '#') {
continue;
}
istringstream iss(line); istringstream iss(line);
string parent, child; string parent, child;
if (!(iss >> parent >> child)) { if (!(iss >> parent >> child)) {
@ -214,8 +217,8 @@ int main(int argc, char** argv)
network.fit(Xd, y, features, className); network.fit(Xd, y, features, className);
cout << "Hello, Bayesian Networks!" << endl; cout << "Hello, Bayesian Networks!" << endl;
showNodesInfo(network, className); showNodesInfo(network, className);
// showCPDS(network); showCPDS(network);
cout << "Score: " << network.score(Xd, y) << endl; //cout << "Score: " << network.score(Xd, y) << endl;
cout << "PyTorch version: " << TORCH_VERSION << endl; cout << "PyTorch version: " << TORCH_VERSION << endl;
return 0; return 0;
} }