Create installation process
This commit is contained in:
parent
199ffc95d2
commit
eba2095718
@ -30,6 +30,7 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
|||||||
option(ENABLE_CLANG_TIDY "Enable to add clang tidy." OFF)
|
option(ENABLE_CLANG_TIDY "Enable to add clang tidy." OFF)
|
||||||
option(ENABLE_TESTING "Unit testing build" OFF)
|
option(ENABLE_TESTING "Unit testing build" OFF)
|
||||||
option(CODE_COVERAGE "Collect coverage from test library" OFF)
|
option(CODE_COVERAGE "Collect coverage from test library" OFF)
|
||||||
|
option(INSTALL_GTEST "Enable installation of googletest." OFF)
|
||||||
|
|
||||||
# CMakes modules
|
# CMakes modules
|
||||||
# --------------
|
# --------------
|
||||||
@ -76,3 +77,12 @@ if (ENABLE_TESTING)
|
|||||||
include(CTest)
|
include(CTest)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
endif (ENABLE_TESTING)
|
endif (ENABLE_TESTING)
|
||||||
|
|
||||||
|
# Installation
|
||||||
|
# ------------
|
||||||
|
install(TARGETS BayesNet
|
||||||
|
ARCHIVE DESTINATION lib
|
||||||
|
LIBRARY DESTINATION lib
|
||||||
|
CONFIGURATIONS Release)
|
||||||
|
install(DIRECTORY src/ DESTINATION include/bayesnet FILES_MATCHING CONFIGURATIONS Release PATTERN "*.h")
|
||||||
|
install(FILES ${CMAKE_BINARY_DIR}/configured_files/include/config.h DESTINATION include/bayesnet CONFIGURATIONS Release)
|
5
Makefile
5
Makefile
@ -47,6 +47,11 @@ clean: ## Clean the tests info
|
|||||||
$(call ClearTests)
|
$(call ClearTests)
|
||||||
@echo ">>> Done";
|
@echo ">>> Done";
|
||||||
|
|
||||||
|
install: ## Install library
|
||||||
|
@echo ">>> Installing BayesNet...";
|
||||||
|
@cmake --install $(f_release)
|
||||||
|
@echo ">>> Done";
|
||||||
|
|
||||||
debug: ## Build a debug version of the project
|
debug: ## Build a debug version of the project
|
||||||
@echo ">>> Building Debug BayesNet...";
|
@echo ">>> Building Debug BayesNet...";
|
||||||
@if [ -d ./$(f_debug) ]; then rm -rf ./$(f_debug); fi
|
@if [ -d ./$(f_debug) ]; then rm -rf ./$(f_debug); fi
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit ed6ac8a629f9a4206575be784c1e340da2a94855
|
Subproject commit 8ac8190e494a381072c89f5e161b92a08d98b37b
|
@ -1,6 +1,6 @@
|
|||||||
#include "ArffFiles.h"
|
#include <ArffFiles.h>
|
||||||
#include "CPPFImdlp.h"
|
#include <CPPFImdlp.h>
|
||||||
#include "BoostAODE.h"
|
#include "ensembles/BoostAODE.h"
|
||||||
|
|
||||||
std::vector<mdlp::labels_t> discretizeDataset(std::vector<mdlp::samples_t>& X, mdlp::labels_t& y)
|
std::vector<mdlp::labels_t> discretizeDataset(std::vector<mdlp::samples_t>& X, mdlp::labels_t& y)
|
||||||
{
|
{
|
||||||
|
@ -4,15 +4,10 @@ include_directories(
|
|||||||
${BayesNet_SOURCE_DIR}/lib/folding
|
${BayesNet_SOURCE_DIR}/lib/folding
|
||||||
${BayesNet_SOURCE_DIR}/lib/json/include
|
${BayesNet_SOURCE_DIR}/lib/json/include
|
||||||
${BayesNet_SOURCE_DIR}/src
|
${BayesNet_SOURCE_DIR}/src
|
||||||
${BayesNet_SOURCE_DIR}/src/feature_selection
|
|
||||||
${BayesNet_SOURCE_DIR}/src/bayesian_network
|
|
||||||
${BayesNet_SOURCE_DIR}/src/classifiers
|
|
||||||
${BayesNet_SOURCE_DIR}/src/ensembles
|
|
||||||
${BayesNet_SOURCE_DIR}/src/utils
|
|
||||||
${CMAKE_BINARY_DIR}/configured_files/include
|
${CMAKE_BINARY_DIR}/configured_files/include
|
||||||
)
|
)
|
||||||
|
|
||||||
file(GLOB_RECURSE Sources "*.cc")
|
file(GLOB_RECURSE Sources "*.cc")
|
||||||
|
|
||||||
add_library(BayesNet ${Sources})
|
add_library(BayesNet ${Sources})
|
||||||
target_link_libraries(BayesNet mdlp "${TORCH_LIBRARIES}")
|
target_link_libraries(BayesNet mdlp "${TORCH_LIBRARIES}")
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include "Network.h"
|
#include "Network.h"
|
||||||
#include "bayesnetUtils.h"
|
#include "utils/bayesnetUtils.h"
|
||||||
namespace bayesnet {
|
namespace bayesnet {
|
||||||
Network::Network() : features(std::vector<std::string>()), className(""), classNumStates(0), fitted(false), laplaceSmoothing(0) {}
|
Network::Network() : features(std::vector<std::string>()), className(""), classNumStates(0), fitted(false), laplaceSmoothing(0) {}
|
||||||
Network::Network(float maxT) : features(std::vector<std::string>()), className(""), classNumStates(0), maxThreads(maxT), fitted(false), laplaceSmoothing(0) {}
|
Network::Network(float maxT) : features(std::vector<std::string>()), className(""), classNumStates(0), maxThreads(maxT), fitted(false), laplaceSmoothing(0) {}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "Classifier.h"
|
#include "Classifier.h"
|
||||||
#include "bayesnetUtils.h"
|
#include "utils/bayesnetUtils.h"
|
||||||
|
|
||||||
namespace bayesnet {
|
namespace bayesnet {
|
||||||
Classifier::Classifier(Network model) : model(model), m(0), n(0), metrics(Metrics()), fitted(false) {}
|
Classifier::Classifier(Network model) : model(model), m(0), n(0), metrics(Metrics()), fitted(false) {}
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
#define CLASSIFIER_H
|
#define CLASSIFIER_H
|
||||||
#include <torch/torch.h>
|
#include <torch/torch.h>
|
||||||
#include "BaseClassifier.h"
|
#include "BaseClassifier.h"
|
||||||
#include "Network.h"
|
#include "bayesian_network/Network.h"
|
||||||
#include "BayesMetrics.h"
|
#include "utils/BayesMetrics.h"
|
||||||
|
|
||||||
namespace bayesnet {
|
namespace bayesnet {
|
||||||
class Classifier : public BaseClassifier {
|
class Classifier : public BaseClassifier {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define KDB_H
|
#define KDB_H
|
||||||
#include <torch/torch.h>
|
#include <torch/torch.h>
|
||||||
#include "Classifier.h"
|
#include "Classifier.h"
|
||||||
#include "bayesnetUtils.h"
|
#include "utils/bayesnetUtils.h"
|
||||||
namespace bayesnet {
|
namespace bayesnet {
|
||||||
class KDB : public Classifier {
|
class KDB : public Classifier {
|
||||||
private:
|
private:
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <torch/torch.h>
|
#include <torch/torch.h>
|
||||||
#include "Network.h"
|
#include "bayesian_network/Network.h"
|
||||||
#include "CPPFImdlp.h"
|
#include "CPPFImdlp.h"
|
||||||
#include "Classifier.h"
|
#include "Classifier.h"
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef AODE_H
|
#ifndef AODE_H
|
||||||
#define AODE_H
|
#define AODE_H
|
||||||
#include "Ensemble.h"
|
#include "Ensemble.h"
|
||||||
#include "SPODE.h"
|
#include "classifiers/SPODE.h"
|
||||||
namespace bayesnet {
|
namespace bayesnet {
|
||||||
class AODE : public Ensemble {
|
class AODE : public Ensemble {
|
||||||
public:
|
public:
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#ifndef AODELD_H
|
#ifndef AODELD_H
|
||||||
#define AODELD_H
|
#define AODELD_H
|
||||||
#include "Ensemble.h"
|
#include "Ensemble.h"
|
||||||
#include "Proposal.h"
|
#include "classifiers/Proposal.h"
|
||||||
#include "SPODELd.h"
|
#include "classifiers/SPODELd.h"
|
||||||
|
|
||||||
namespace bayesnet {
|
namespace bayesnet {
|
||||||
class AODELd : public Ensemble, public Proposal {
|
class AODELd : public Ensemble, public Proposal {
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
#include <folding.hpp>
|
||||||
#include "BoostAODE.h"
|
#include "BoostAODE.h"
|
||||||
#include "CFS.h"
|
#include "feature_selection/CFS.h"
|
||||||
#include "FCBF.h"
|
#include "feature_selection/FCBF.h"
|
||||||
#include "IWSS.h"
|
#include "feature_selection/IWSS.h"
|
||||||
#include "folding.hpp"
|
|
||||||
|
|
||||||
namespace bayesnet {
|
namespace bayesnet {
|
||||||
struct {
|
struct {
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
#define BOOSTAODE_H
|
#define BOOSTAODE_H
|
||||||
#include "Ensemble.h"
|
#include "Ensemble.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
#include "SPODE.h"
|
#include "classifiers/SPODE.h"
|
||||||
#include "FeatureSelect.h"
|
#include "feature_selection/FeatureSelect.h"
|
||||||
namespace bayesnet {
|
namespace bayesnet {
|
||||||
class BoostAODE : public Ensemble {
|
class BoostAODE : public Ensemble {
|
||||||
public:
|
public:
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#ifndef ENSEMBLE_H
|
#ifndef ENSEMBLE_H
|
||||||
#define ENSEMBLE_H
|
#define ENSEMBLE_H
|
||||||
#include <torch/torch.h>
|
#include <torch/torch.h>
|
||||||
#include "Classifier.h"
|
#include "classifiers/Classifier.h"
|
||||||
#include "BayesMetrics.h"
|
#include "utils/BayesMetrics.h"
|
||||||
#include "bayesnetUtils.h"
|
#include "utils/bayesnetUtils.h"
|
||||||
|
|
||||||
namespace bayesnet {
|
namespace bayesnet {
|
||||||
class Ensemble : public Classifier {
|
class Ensemble : public Classifier {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "CFS.h"
|
#include "CFS.h"
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include "bayesnetUtils.h"
|
#include "utils/bayesnetUtils.h"
|
||||||
namespace bayesnet {
|
namespace bayesnet {
|
||||||
void CFS::fit()
|
void CFS::fit()
|
||||||
{
|
{
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define CFS_H
|
#define CFS_H
|
||||||
#include <torch/torch.h>
|
#include <torch/torch.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "FeatureSelect.h"
|
#include "feature_selection/FeatureSelect.h"
|
||||||
namespace bayesnet {
|
namespace bayesnet {
|
||||||
class CFS : public FeatureSelect {
|
class CFS : public FeatureSelect {
|
||||||
public:
|
public:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "bayesnetUtils.h"
|
#include "utils/bayesnetUtils.h"
|
||||||
#include "FCBF.h"
|
#include "FCBF.h"
|
||||||
namespace bayesnet {
|
namespace bayesnet {
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define FCBF_H
|
#define FCBF_H
|
||||||
#include <torch/torch.h>
|
#include <torch/torch.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "FeatureSelect.h"
|
#include "feature_selection/FeatureSelect.h"
|
||||||
namespace bayesnet {
|
namespace bayesnet {
|
||||||
class FCBF : public FeatureSelect {
|
class FCBF : public FeatureSelect {
|
||||||
public:
|
public:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "FeatureSelect.h"
|
#include "FeatureSelect.h"
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include "bayesnetUtils.h"
|
#include "utils/bayesnetUtils.h"
|
||||||
namespace bayesnet {
|
namespace bayesnet {
|
||||||
FeatureSelect::FeatureSelect(const torch::Tensor& samples, const std::vector<std::string>& features, const std::string& className, const int maxFeatures, const int classNumStates, const torch::Tensor& weights) :
|
FeatureSelect::FeatureSelect(const torch::Tensor& samples, const std::vector<std::string>& features, const std::string& className, const int maxFeatures, const int classNumStates, const torch::Tensor& weights) :
|
||||||
Metrics(samples, features, className, classNumStates), maxFeatures(maxFeatures == 0 ? samples.size(0) - 1 : maxFeatures), weights(weights)
|
Metrics(samples, features, className, classNumStates), maxFeatures(maxFeatures == 0 ? samples.size(0) - 1 : maxFeatures), weights(weights)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define FEATURE_SELECT_H
|
#define FEATURE_SELECT_H
|
||||||
#include <torch/torch.h>
|
#include <torch/torch.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "BayesMetrics.h"
|
#include "utils/BayesMetrics.h"
|
||||||
namespace bayesnet {
|
namespace bayesnet {
|
||||||
class FeatureSelect : public Metrics {
|
class FeatureSelect : public Metrics {
|
||||||
public:
|
public:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "IWSS.h"
|
#include "IWSS.h"
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include "bayesnetUtils.h"
|
#include "utils/bayesnetUtils.h"
|
||||||
namespace bayesnet {
|
namespace bayesnet {
|
||||||
IWSS::IWSS(const torch::Tensor& samples, const std::vector<std::string>& features, const std::string& className, const int maxFeatures, const int classNumStates, const torch::Tensor& weights, const double threshold) :
|
IWSS::IWSS(const torch::Tensor& samples, const std::vector<std::string>& features, const std::string& className, const int maxFeatures, const int classNumStates, const torch::Tensor& weights, const double threshold) :
|
||||||
FeatureSelect(samples, features, className, maxFeatures, classNumStates, weights), threshold(threshold)
|
FeatureSelect(samples, features, className, maxFeatures, classNumStates, weights), threshold(threshold)
|
||||||
|
Loading…
Reference in New Issue
Block a user