refactor main
This commit is contained in:
parent
e3863387bb
commit
29aca0b35f
@ -259,30 +259,30 @@ int main(int argc, char** argv)
|
|||||||
}
|
}
|
||||||
states[className] = vector<int>(
|
states[className] = vector<int>(
|
||||||
maxes[className]);
|
maxes[className]);
|
||||||
cout << "****************** KDB ******************" << endl;
|
// cout << "****************** KDB ******************" << endl;
|
||||||
auto kdb = bayesnet::KDB(2);
|
// auto kdb = bayesnet::KDB(2);
|
||||||
kdb.fit(Xd, y, features, className, states);
|
// kdb.fit(Xd, y, features, className, states);
|
||||||
for (auto line : kdb.show()) {
|
// for (auto line : kdb.show()) {
|
||||||
cout << line << endl;
|
// cout << line << endl;
|
||||||
}
|
// }
|
||||||
cout << "Score: " << kdb.score(Xd, y) << endl;
|
// cout << "Score: " << kdb.score(Xd, y) << endl;
|
||||||
cout << "****************** KDB ******************" << endl;
|
// cout << "****************** KDB ******************" << endl;
|
||||||
cout << "****************** SPODE ******************" << endl;
|
// cout << "****************** SPODE ******************" << endl;
|
||||||
auto spode = bayesnet::SPODE(2);
|
// auto spode = bayesnet::SPODE(2);
|
||||||
spode.fit(Xd, y, features, className, states);
|
// spode.fit(Xd, y, features, className, states);
|
||||||
for (auto line : spode.show()) {
|
// for (auto line : spode.show()) {
|
||||||
cout << line << endl;
|
// cout << line << endl;
|
||||||
}
|
// }
|
||||||
cout << "Score: " << spode.score(Xd, y) << endl;
|
// cout << "Score: " << spode.score(Xd, y) << endl;
|
||||||
cout << "****************** SPODE ******************" << endl;
|
// cout << "****************** SPODE ******************" << endl;
|
||||||
cout << "****************** AODE ******************" << endl;
|
// cout << "****************** AODE ******************" << endl;
|
||||||
auto aode = bayesnet::AODE();
|
// auto aode = bayesnet::AODE();
|
||||||
aode.fit(Xd, y, features, className, states);
|
// aode.fit(Xd, y, features, className, states);
|
||||||
for (auto line : aode.show()) {
|
// for (auto line : aode.show()) {
|
||||||
cout << line << endl;
|
// cout << line << endl;
|
||||||
}
|
// }
|
||||||
cout << "Score: " << aode.score(Xd, y) << endl;
|
// cout << "Score: " << aode.score(Xd, y) << endl;
|
||||||
cout << "****************** AODE ******************" << endl;
|
// cout << "****************** AODE ******************" << endl;
|
||||||
cout << "****************** TAN ******************" << endl;
|
cout << "****************** TAN ******************" << endl;
|
||||||
auto tan = bayesnet::TAN();
|
auto tan = bayesnet::TAN();
|
||||||
tan.fit(Xd, y, features, className, states);
|
tan.fit(Xd, y, features, className, states);
|
||||||
|
@ -127,6 +127,5 @@ namespace bayesnet {
|
|||||||
auto result = vector<pair<int, int>>();
|
auto result = vector<pair<int, int>>();
|
||||||
auto mst = MST(features, weights, root);
|
auto mst = MST(features, weights, root);
|
||||||
return mst.maximumSpanningTree();
|
return mst.maximumSpanningTree();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -108,7 +108,6 @@ namespace bayesnet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
g.kruskal_algorithm();
|
g.kruskal_algorithm();
|
||||||
//g.display_mst();
|
|
||||||
auto mst = g.get_mst();
|
auto mst = g.get_mst();
|
||||||
return reorder(mst, root);
|
return reorder(mst, root);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user