Update models versions

This commit is contained in:
2024-06-13 12:30:31 +02:00
parent e628d80f4c
commit 3d900f8c81
10 changed files with 60 additions and 35 deletions

View File

@@ -13,10 +13,10 @@ if(ENABLE_TESTING)
)
set(TEST_SOURCES_PLATFORM
TestUtils.cpp TestPlatform.cpp TestResult.cpp TestScores.cpp
${Platform_SOURCE_DIR}/src/common/Datasets.cpp ${Platform_SOURCE_DIR}/src/common/Dataset.cpp
${Platform_SOURCE_DIR}/src/common/Datasets.cpp ${Platform_SOURCE_DIR}/src/common/Dataset.cpp ${Platform_SOURCE_DIR}/src/common/Discretization.cpp
${Platform_SOURCE_DIR}/src/main/Scores.cpp
)
add_executable(${TEST_PLATFORM} ${TEST_SOURCES_PLATFORM})
target_link_libraries(${TEST_PLATFORM} PUBLIC "${TORCH_LIBRARIES}" ArffFiles mdlp Catch2::Catch2WithMain BayesNet)
target_link_libraries(${TEST_PLATFORM} PUBLIC "${TORCH_LIBRARIES}" mdlp Catch2::Catch2WithMain BayesNet)
add_test(NAME ${TEST_PLATFORM} COMMAND ${TEST_PLATFORM})
endif(ENABLE_TESTING)

View File

@@ -7,6 +7,7 @@
#include <string>
#include "TestUtils.h"
#include "folding.hpp"
#include <ArffFiles.hpp>
#include <bayesnet/classifiers/TAN.h>
#include "config.h"
@@ -14,7 +15,7 @@
TEST_CASE("Test Platform version", "[Platform]")
{
std::string version = { platform_project_version.begin(), platform_project_version.end() };
REQUIRE(version == "1.0.4");
REQUIRE(version == "1.1.0");
}
TEST_CASE("Test Folding library version", "[Folding]")
{
@@ -24,10 +25,15 @@ TEST_CASE("Test Folding library version", "[Folding]")
TEST_CASE("Test BayesNet version", "[BayesNet]")
{
std::string version = bayesnet::TAN().getVersion();
REQUIRE(version == "1.0.5.1");
REQUIRE(version == "1.0.6");
}
TEST_CASE("Test mdlp version", "[mdlp]")
{
std::string version = mdlp::CPPFImdlp::version();
REQUIRE(version == "1.1.2");
REQUIRE(version == "1.2.1");
}
TEST_CASE("Test Arff version", "[Arff]")
{
std::string version = ArffFiles().version();
REQUIRE(version == "1.1.0");
}

View File

@@ -13,13 +13,14 @@
TEST_CASE("ZeroR comparison in reports", "[Report]")
{
auto dotEnv = platform::DotEnv(true);
auto margin = 1e-2;
std::string dataset = "liver-disorders";
auto margin = 1e-4;
std::string dataset_name = "liver-disorders";
auto dt = platform::Datasets(false, platform::Paths::datasets());
dt.loadDataset(dataset);
std::vector<int> distribution = dt.getClassesCounts(dataset);
double nSamples = dt.getNSamples(dataset);
auto& dataset = dt.getDataset(dataset_name);
dataset.load();
std::vector<int> distribution = dataset.getClassesCounts();
double nSamples = dataset.getNSamples();
std::vector<int>::iterator maxValue = max_element(distribution.begin(), distribution.end());
double mark = *maxValue / nSamples * (1 + margin);
REQUIRE(mark == Catch::Approx(0.585507f).epsilon(1e-5));
REQUIRE(mark == Catch::Approx(0.57976811f).epsilon(margin));
}

View File

@@ -128,7 +128,7 @@ TEST_CASE("Confusion Matrix JSON", "[Scores]")
REQUIRE(res_json_str["Car"][1] == 2);
REQUIRE(res_json_str["Car"][2] == 3);
}
TEST_CASE("Classification Report", "[Scores]") -
TEST_CASE("Classification Report", "[Scores]")
{
std::vector<int> y_test = { 0, 2, 2, 2, 2, 0, 1, 2, 0, 2 };
std::vector<int> y_pred = { 0, 1, 2, 2, 1, 1, 1, 0, 0, 2 };

View File

@@ -5,7 +5,7 @@
#include <vector>
#include <map>
#include <tuple>
#include "ArffFiles.h"
#include <ArffFiles.hpp>
#include "CPPFImdlp.h"
bool file_exists(const std::string& name);

View File

@@ -1,8 +1,8 @@
diabetes,class, all
ecoli,class, all
glass,Type, all
iris,class, all
kdd_JapaneseVowels,speaker, [2,3,4,5,6,7,8,9,10,11,12,13]
letter,class, all
liver-disorders,selector, all
mfeat-factors,class, all
diabetes;class;all
ecoli;class;all
glass;Type,all
iris;class;all
kdd_JapaneseVowels;speaker;[2,3,4,5,6,7,8,9,10,11,12,13]
letter;class;all
liver-disorders;selector;all
mfeat-factors;class;all