Refactor library structure
This commit is contained in:
130
.vscode/launch.json
vendored
130
.vscode/launch.json
vendored
@@ -1,130 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"type": "lldb",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "sample",
|
|
||||||
"program": "${workspaceFolder}/build_debug/sample/BayesNetSample",
|
|
||||||
"args": [
|
|
||||||
"-d",
|
|
||||||
"iris",
|
|
||||||
"-m",
|
|
||||||
"TANLd",
|
|
||||||
"-s",
|
|
||||||
"271",
|
|
||||||
"-p",
|
|
||||||
"/Users/rmontanana/Code/discretizbench/datasets/",
|
|
||||||
],
|
|
||||||
//"cwd": "${workspaceFolder}/build/sample/",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "lldb",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "experimentPy",
|
|
||||||
"program": "${workspaceFolder}/build_debug/src/Platform/b_main",
|
|
||||||
"args": [
|
|
||||||
"-m",
|
|
||||||
"STree",
|
|
||||||
"--stratified",
|
|
||||||
"-d",
|
|
||||||
"iris",
|
|
||||||
//"--discretize"
|
|
||||||
// "--hyperparameters",
|
|
||||||
// "{\"repeatSparent\": true, \"maxModels\": 12}"
|
|
||||||
],
|
|
||||||
"cwd": "${workspaceFolder}/../discretizbench",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "lldb",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "gridsearch",
|
|
||||||
"program": "${workspaceFolder}/build_debug/src/Platform/b_grid",
|
|
||||||
"args": [
|
|
||||||
"-m",
|
|
||||||
"KDB",
|
|
||||||
"--discretize",
|
|
||||||
"--continue",
|
|
||||||
"glass",
|
|
||||||
"--only",
|
|
||||||
"--compute"
|
|
||||||
],
|
|
||||||
"cwd": "${workspaceFolder}/../discretizbench",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "lldb",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "experimentBayes",
|
|
||||||
"program": "${workspaceFolder}/build_debug/src/Platform/b_main",
|
|
||||||
"args": [
|
|
||||||
"-m",
|
|
||||||
"TAN",
|
|
||||||
"--stratified",
|
|
||||||
"--discretize",
|
|
||||||
"-d",
|
|
||||||
"iris",
|
|
||||||
"--hyperparameters",
|
|
||||||
"{\"repeatSparent\": true, \"maxModels\": 12}"
|
|
||||||
],
|
|
||||||
"cwd": "/home/rmontanana/Code/discretizbench",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "lldb",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "best",
|
|
||||||
"program": "${workspaceFolder}/build_debug/src/Platform/b_best",
|
|
||||||
"args": [
|
|
||||||
"-m",
|
|
||||||
"BoostAODE",
|
|
||||||
"-s",
|
|
||||||
"accuracy",
|
|
||||||
"--build",
|
|
||||||
],
|
|
||||||
"cwd": "${workspaceFolder}/../discretizbench",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "lldb",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "manage",
|
|
||||||
"program": "${workspaceFolder}/build_debug/src/Platform/b_manage",
|
|
||||||
"args": [
|
|
||||||
"-n",
|
|
||||||
"20"
|
|
||||||
],
|
|
||||||
"cwd": "${workspaceFolder}/../discretizbench",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "lldb",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "list",
|
|
||||||
"program": "${workspaceFolder}/build_debug/src/Platform/b_list",
|
|
||||||
"args": [],
|
|
||||||
//"cwd": "/Users/rmontanana/Code/discretizbench",
|
|
||||||
"cwd": "${workspaceFolder}/../discretizbench",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "lldb",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "test",
|
|
||||||
"program": "${workspaceFolder}/build_debug/tests/unit_tests",
|
|
||||||
"args": [
|
|
||||||
"-c=\"Metrics Test\"",
|
|
||||||
// "-s",
|
|
||||||
],
|
|
||||||
"cwd": "${workspaceFolder}/build/tests",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Build & debug active file",
|
|
||||||
"type": "cppdbg",
|
|
||||||
"request": "launch",
|
|
||||||
"program": "${workspaceFolder}/build_debug/bayesnet",
|
|
||||||
"args": [],
|
|
||||||
"stopAtEntry": false,
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"environment": [],
|
|
||||||
"externalConsole": false,
|
|
||||||
"MIMode": "lldb",
|
|
||||||
"preLaunchTask": "CMake: build"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@@ -69,7 +69,7 @@ find_library(BayesNet NAMES libBayesNet BayesNet)
|
|||||||
|
|
||||||
# Subdirectories
|
# Subdirectories
|
||||||
# --------------
|
# --------------
|
||||||
add_subdirectory(src)
|
add_subdirectory(pyclfs)
|
||||||
|
|
||||||
# Testing
|
# Testing
|
||||||
# -------
|
# -------
|
||||||
@@ -88,5 +88,5 @@ install(TARGETS PyClassifiers
|
|||||||
ARCHIVE DESTINATION lib
|
ARCHIVE DESTINATION lib
|
||||||
LIBRARY DESTINATION lib
|
LIBRARY DESTINATION lib
|
||||||
CONFIGURATIONS Release)
|
CONFIGURATIONS Release)
|
||||||
install(DIRECTORY src/ DESTINATION include/pyclassifiers FILES_MATCHING CONFIGURATIONS Release PATTERN "*.h" PATTERN "*.hpp")
|
install(DIRECTORY pyclfs/ DESTINATION include/pyclassifiers FILES_MATCHING CONFIGURATIONS Release PATTERN "*.h" PATTERN "*.hpp")
|
||||||
install(FILES /usr/local/include/bayesnet/config.h DESTINATION include/pyclassifiers CONFIGURATIONS Release)
|
install(FILES /usr/local/include/bayesnet/config.h DESTINATION include/pyclassifiers CONFIGURATIONS Release)
|
@@ -1,4 +1,4 @@
|
|||||||
filter = src/
|
filter = pyclfs/
|
||||||
exclude-directories = build_debug/lib/
|
exclude-directories = build_debug/lib/
|
||||||
print-summary = yes
|
print-summary = yes
|
||||||
sort-percentage = yes
|
sort-percentage = yes
|
||||||
|
@@ -2,7 +2,7 @@ include_directories(
|
|||||||
${Python3_INCLUDE_DIRS}
|
${Python3_INCLUDE_DIRS}
|
||||||
${TORCH_INCLUDE_DIRS}
|
${TORCH_INCLUDE_DIRS}
|
||||||
${PyClassifiers_SOURCE_DIR}/lib/json/include
|
${PyClassifiers_SOURCE_DIR}/lib/json/include
|
||||||
/usr/local/include/bayesnet
|
/usr/local/include
|
||||||
)
|
)
|
||||||
add_library(PyClassifiers ODTE.cc STree.cc SVC.cc RandomForest.cc XGBoost.cc PyClassifier.cc PyWrap.cc)
|
add_library(PyClassifiers ODTE.cc STree.cc SVC.cc RandomForest.cc XGBoost.cc PyClassifier.cc PyWrap.cc)
|
||||||
target_link_libraries(PyClassifiers ${Python3_LIBRARIES} "${TORCH_LIBRARIES}" ${LIBTORCH_PYTHON} Boost::boost Boost::python Boost::numpy)
|
target_link_libraries(PyClassifiers ${Python3_LIBRARIES} "${TORCH_LIBRARIES}" ${LIBTORCH_PYTHON} Boost::boost Boost::python Boost::numpy)
|
@@ -1,15 +1,15 @@
|
|||||||
#ifndef PYCLASSIFIER_H
|
#ifndef PYCLASSIFIER_H
|
||||||
#define PYCLASSIFIER_H
|
#define PYCLASSIFIER_H
|
||||||
#include "boost/python/detail/wrap_python.hpp"
|
|
||||||
#include <boost/python/numpy.hpp>
|
|
||||||
#include <nlohmann/json.hpp>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#include "boost/python/detail/wrap_python.hpp"
|
||||||
|
#include <boost/python/numpy.hpp>
|
||||||
#include <torch/torch.h>
|
#include <torch/torch.h>
|
||||||
|
#include <nlohmann/json.hpp>
|
||||||
|
#include "bayesnet/classifiers/Classifier.h"
|
||||||
#include "PyWrap.h"
|
#include "PyWrap.h"
|
||||||
#include "classifiers/Classifier.h"
|
|
||||||
#include "TypeId.h"
|
#include "TypeId.h"
|
||||||
|
|
||||||
namespace pywrap {
|
namespace pywrap {
|
@@ -1,11 +1,11 @@
|
|||||||
#ifndef PYWRAP_H
|
#ifndef PYWRAP_H
|
||||||
#define PYWRAP_H
|
#define PYWRAP_H
|
||||||
#include "boost/python/detail/wrap_python.hpp"
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
#include "boost/python/detail/wrap_python.hpp"
|
||||||
#include "PyHelper.hpp"
|
#include "PyHelper.hpp"
|
||||||
#include "TypeId.h"
|
#include "TypeId.h"
|
||||||
#pragma once
|
#pragma once
|
@@ -1,15 +1,15 @@
|
|||||||
if(ENABLE_TESTING)
|
if(ENABLE_TESTING)
|
||||||
set(TEST_PYCLASSIFIERS "unit_tests_pyclassifiers")
|
set(TEST_PYCLASSIFIERS "unit_tests_pyclassifiers")
|
||||||
include_directories(
|
include_directories(
|
||||||
${PyClassifiers_SOURCE_DIR}/src/
|
${PyClassifiers_SOURCE_DIR}
|
||||||
${PyClassifiers_SOURCE_DIR}/lib/Files
|
${PyClassifiers_SOURCE_DIR}/lib/Files
|
||||||
${PyClassifiers_SOURCE_DIR}/lib/mdlp
|
${PyClassifiers_SOURCE_DIR}/lib/mdlp
|
||||||
${PyClassifiers_SOURCE_DIR}/lib/json/include
|
${PyClassifiers_SOURCE_DIR}/lib/json/include
|
||||||
${Python3_INCLUDE_DIRS}
|
${Python3_INCLUDE_DIRS}
|
||||||
${TORCH_INCLUDE_DIRS}
|
${TORCH_INCLUDE_DIRS}
|
||||||
/usr/local/include/bayesnet
|
/usr/local/include
|
||||||
)
|
)
|
||||||
file(GLOB_RECURSE PyClassifiers_SOURCES "${PyClassifiers_SOURCE_DIR}/src/*.cc")
|
file(GLOB_RECURSE PyClassifiers_SOURCES "${PyClassifiers_SOURCE_DIR}/pyclfs/*.cc")
|
||||||
set(TEST_SOURCES_PYCLASSIFIERS TestPythonClassifiers.cc TestUtils.cc ${PyClassifiers_SOURCES})
|
set(TEST_SOURCES_PYCLASSIFIERS TestPythonClassifiers.cc TestUtils.cc ${PyClassifiers_SOURCES})
|
||||||
add_executable(${TEST_PYCLASSIFIERS} ${TEST_SOURCES_PYCLASSIFIERS})
|
add_executable(${TEST_PYCLASSIFIERS} ${TEST_SOURCES_PYCLASSIFIERS})
|
||||||
target_link_libraries(${TEST_PYCLASSIFIERS} PUBLIC "${TORCH_LIBRARIES}" ${Python3_LIBRARIES} ${LIBTORCH_PYTHON} Boost::boost Boost::python Boost::numpy ArffFiles mdlp Catch2::Catch2WithMain)
|
target_link_libraries(${TEST_PYCLASSIFIERS} PUBLIC "${TORCH_LIBRARIES}" ${Python3_LIBRARIES} ${LIBTORCH_PYTHON} Boost::boost Boost::python Boost::numpy ArffFiles mdlp Catch2::Catch2WithMain)
|
||||||
|
@@ -1,17 +1,17 @@
|
|||||||
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do
|
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do
|
||||||
#include <catch2/catch_test_macros.hpp>
|
|
||||||
#include <catch2/catch_approx.hpp>
|
|
||||||
#include <catch2/generators/catch_generators.hpp>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "STree.h"
|
#include <catch2/catch_test_macros.hpp>
|
||||||
#include "SVC.h"
|
#include <catch2/catch_approx.hpp>
|
||||||
#include "RandomForest.h"
|
#include <catch2/generators/catch_generators.hpp>
|
||||||
#include "XGBoost.h"
|
|
||||||
#include "ODTE.h"
|
|
||||||
#include "TestUtils.h"
|
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
#include "pyclfs/STree.h"
|
||||||
|
#include "pyclfs/SVC.h"
|
||||||
|
#include "pyclfs/RandomForest.h"
|
||||||
|
#include "pyclfs/XGBoost.h"
|
||||||
|
#include "pyclfs/ODTE.h"
|
||||||
|
#include "TestUtils.h"
|
||||||
|
|
||||||
const std::string ACTUAL_VERSION = "1.0.4";
|
const std::string ACTUAL_VERSION = "1.0.4";
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#include "TestUtils.h"
|
#include "TestUtils.h"
|
||||||
#include "config.h"
|
#include "bayesnet/config.h"
|
||||||
|
|
||||||
class Paths {
|
class Paths {
|
||||||
public:
|
public:
|
||||||
|
Reference in New Issue
Block a user