diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c4e4ab0..ed94eba 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,10 +2,12 @@ include_directories( ${PyClassifiers_SOURCE_DIR}/lib/Files ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/lib/json/include ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/src + ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/src/classifiers + ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/src/bayesian_network + ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/src/utils ${CMAKE_BINARY_DIR}/configured_files/include ${Python3_INCLUDE_DIRS} ${TORCH_INCLUDE_DIRS} ) add_library(PyClassifiers SHARED ${PyClassifiers_SOURCES}) -#target_link_libraries(PyClassifiers ${Python3_LIBRARIES} "${TORCH_LIBRARIES}" ${LIBTORCH_PYTHON} Boost::boost Boost::python Boost::numpy xgboost::xgboost) target_link_libraries(PyClassifiers BayesNet ${Python3_LIBRARIES} "${TORCH_LIBRARIES}" ${LIBTORCH_PYTHON} Boost::boost Boost::python Boost::numpy) \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7206cc9..465f026 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,6 +6,9 @@ if(ENABLE_TESTING) ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/lib/Files ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/lib/mdlp ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/src + ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/src/classifiers + ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/src/bayesian_network + ${PyClassifiers_SOURCE_DIR}/lib/BayesNet/src/utils ${Python3_INCLUDE_DIRS} ${TORCH_INCLUDE_DIRS} ${CMAKE_BINARY_DIR}/configured_files/include diff --git a/tests/TestPythonClassifiers.cc b/tests/TestPythonClassifiers.cc index 0407920..3856ec9 100644 --- a/tests/TestPythonClassifiers.cc +++ b/tests/TestPythonClassifiers.cc @@ -35,11 +35,12 @@ TEST_CASE("Test Python Classifiers score", "[PyClassifiers]") }; SECTION("Test Python Classifier " + name + " score ") { - for (auto file_name : { "glass", "iris", "ecoli", "diabetes" }) { + for (std::string file_name : { "glass", "iris", "ecoli", "diabetes" }) { auto raw = RawDatasets(file_name, false); auto clf = models[name]; clf->fit(raw.Xt, raw.yt, raw.featurest, raw.classNamet, raw.statest); auto score = clf->score(raw.Xt, raw.yt); + INFO("File: " + file_name + " Classifier: " + name + " Score: " + to_string(score)); REQUIRE(score == Catch::Approx(scores[{file_name, name}]).epsilon(raw.epsilon)); } }