Add dump_cpt classifier test
This commit is contained in:
parent
09a1369122
commit
464fe029ea
@ -5,7 +5,7 @@
|
|||||||
![Gitea Release](https://img.shields.io/gitea/v/release/rmontanana/bayesnet?gitea_url=https://gitea.rmontanana.es:3000)
|
![Gitea Release](https://img.shields.io/gitea/v/release/rmontanana/bayesnet?gitea_url=https://gitea.rmontanana.es:3000)
|
||||||
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/cf3e0ac71d764650b1bf4d8d00d303b1)](https://app.codacy.com/gh/Doctorado-ML/BayesNet/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
|
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/cf3e0ac71d764650b1bf4d8d00d303b1)](https://app.codacy.com/gh/Doctorado-ML/BayesNet/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
|
||||||
![Gitea Last Commit](https://img.shields.io/gitea/last-commit/rmontanana/bayesnet?gitea_url=https://gitea.rmontanana.es:3000&logo=gitea)
|
![Gitea Last Commit](https://img.shields.io/gitea/last-commit/rmontanana/bayesnet?gitea_url=https://gitea.rmontanana.es:3000&logo=gitea)
|
||||||
![Static Badge](https://img.shields.io/badge/Coverage-97,1%25-green)
|
![Static Badge](https://img.shields.io/badge/Coverage-97,2%25-green)
|
||||||
|
|
||||||
Bayesian Network Classifiers using libtorch from scratch
|
Bayesian Network Classifiers using libtorch from scratch
|
||||||
|
|
||||||
|
@ -79,6 +79,14 @@ TEST_CASE("Topological order", "[Classifier]")
|
|||||||
REQUIRE(order[2] == "sepalwidth");
|
REQUIRE(order[2] == "sepalwidth");
|
||||||
REQUIRE(order[3] == "petalwidth");
|
REQUIRE(order[3] == "petalwidth");
|
||||||
}
|
}
|
||||||
|
TEST_CASE("Dump_cpt", "[Classifier]")
|
||||||
|
{
|
||||||
|
auto model = bayesnet::TAN();
|
||||||
|
auto raw = RawDatasets("iris", true);
|
||||||
|
model.fit(raw.Xt, raw.yt, raw.featurest, raw.classNamet, raw.statest);
|
||||||
|
auto cpt = model.dump_cpt();
|
||||||
|
REQUIRE(cpt.size() == 1713);
|
||||||
|
}
|
||||||
TEST_CASE("Not fitted model", "[Classifier]")
|
TEST_CASE("Not fitted model", "[Classifier]")
|
||||||
{
|
{
|
||||||
auto model = bayesnet::TAN();
|
auto model = bayesnet::TAN();
|
||||||
|
Loading…
Reference in New Issue
Block a user