diff --git a/.gitignore b/.gitignore index 268bb77..c4d9bf1 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ cmake-build*/** .idea puml/** .vscode/settings.json +*.dot diff --git a/.gitmodules b/.gitmodules index 37581d1..da340e7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "lib/mdlp"] path = lib/mdlp url = https://github.com/rmontanana/mdlp +[submodule "lib/PyClassifiers"] + path = lib/PyClassifiers + url = https://github.com/rmontanana/PyClassifiers diff --git a/Makefile b/Makefile index 1fda9bf..e3ccdbb 100644 --- a/Makefile +++ b/Makefile @@ -56,10 +56,10 @@ dependency: ## Create a dependency graph diagram of the project (build/dependenc cd $(f_debug) && cmake .. --graphviz=dependency.dot && dot -Tpng dependency.dot -o dependency.png buildd: ## Build the debug targets - cmake --build $(f_debug) -t $(app_targets) BayesNetSample $(n_procs) + cmake --build $(f_debug) -t $(app_targets) PlatformSample $(n_procs) buildr: ## Build the release targets - cmake --build $(f_release) -t $(app_targets) BayesNetSample $(n_procs) + cmake --build $(f_release) -t $(app_targets) $(n_procs) clean: ## Clean the tests info @echo ">>> Cleaning Debug BayesNet tests..."; diff --git a/lib/PyClassifiers b/lib/PyClassifiers new file mode 160000 index 0000000..f46f6dc --- /dev/null +++ b/lib/PyClassifiers @@ -0,0 +1 @@ +Subproject commit f46f6dcbb270413ec9760b5de7abb81f6a932df6 diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index b469786..43ebfcc 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -1,11 +1,14 @@ include_directories( ${Platform_SOURCE_DIR}/src/Platform - ${Platform_SOURCE_DIR}/src/PyClassifiers + ${Platform_SOURCE_DIR}/lib/PyClassifiers/src/PyClassifiers ${Python3_INCLUDE_DIRS} ${Platform_SOURCE_DIR}/lib/Files - ${Platform_SOURCE_DIR}/lib/mdlp ${Platform_SOURCE_DIR}/lib/argparse/include - ${Platform_SOURCE_DIR}/lib/json/include + ${Platform_SOURCE_DIR}/lib/PyClassifiers/lib/BayesNet/src/BayesNet + ${Platform_SOURCE_DIR}/lib/PyClassifiers/lib/BayesNet/lib/folding + ${Platform_SOURCE_DIR}/lib/PyClassifiers/lib/BayesNet/lib/mdlp + ${Platform_SOURCE_DIR}/lib/PyClassifiers/lib/BayesNet/lib/json/include + ${CMAKE_BINARY_DIR}/configured_files/include ) add_executable(PlatformSample sample.cc ${Platform_SOURCE_DIR}/src/Platform/Models.cc) -target_link_libraries(PlatformSample Platform ArffFiles mdlp "${TORCH_LIBRARIES}" PyWrap) \ No newline at end of file +target_link_libraries(PlatformSample PyClassifiers ArffFiles mdlp "${TORCH_LIBRARIES}") \ No newline at end of file diff --git a/sample/sample.cc b/sample/sample.cc index 2de85be..b96436f 100644 --- a/sample/sample.cc +++ b/sample/sample.cc @@ -70,7 +70,7 @@ int main(int argc, char** argv) auto valid_datasets = std::vector(); transform(datasets.begin(), datasets.end(), back_inserter(valid_datasets), [](const pair& pair) { return pair.first; }); - argparse::ArgumentParser program("BayesNetSample"); + argparse::ArgumentParser program("PlatformSample"); program.add_argument("-d", "--dataset") .help("Dataset file name") .action([valid_datasets](const std::string& value) { @@ -194,7 +194,7 @@ int main(int argc, char** argv) Xt.index_put_({ i, "..." }, torch::tensor(Xd[i], torch::kInt32)); } float total_score = 0, total_score_train = 0, score_train, score_test; - platform::Fold* fold; + folding::Fold* fold; if (stratified) fold = new folding::StratifiedKFold(nFolds, y, seed); else diff --git a/src/Platform/CMakeLists.txt b/src/Platform/CMakeLists.txt index 0299426..6a972dd 100644 --- a/src/Platform/CMakeLists.txt +++ b/src/Platform/CMakeLists.txt @@ -22,7 +22,7 @@ add_executable(b_main b_main.cc Experiment.cc Datasets.cc Dataset.cc Models.cc H add_executable(b_manage b_manage.cc Results.cc ManageResults.cc CommandParser.cc Result.cc ReportConsole.cc ReportExcel.cc ReportBase.cc Datasets.cc Dataset.cc ExcelFile.cc) target_link_libraries(b_best Boost::boost "${XLSXWRITER_LIB}" "${TORCH_LIBRARIES}" ArffFiles mdlp) -target_link_libraries(b_grid PyClassifiers ${MPI_CXX_LIBRARIES}) +target_link_libraries(b_grid PyClassifiers ${MPI_CXX_LIBRARIES} ArffFiles) target_link_libraries(b_list ArffFiles mdlp "${TORCH_LIBRARIES}") target_link_libraries(b_main PyClassifiers BayesNet ArffFiles mdlp "${TORCH_LIBRARIES}") target_link_libraries(b_manage "${TORCH_LIBRARIES}" "${XLSXWRITER_LIB}" ArffFiles mdlp) \ No newline at end of file