Compare commits
3 Commits
51f32113c0
...
5cd6e3d1a5
Author | SHA1 | Date | |
---|---|---|---|
5cd6e3d1a5
|
|||
d9e9356d92
|
|||
0010c840d1
|
@@ -4,8 +4,8 @@ diagrams:
|
|||||||
Platform:
|
Platform:
|
||||||
type: class
|
type: class
|
||||||
glob:
|
glob:
|
||||||
- src/*.cc
|
- src/*.cpp
|
||||||
- src/modules/*.cc
|
- src/modules/*.cpp
|
||||||
using_namespace: platform
|
using_namespace: platform
|
||||||
include:
|
include:
|
||||||
namespaces:
|
namespaces:
|
||||||
@@ -17,7 +17,7 @@ diagrams:
|
|||||||
sequence:
|
sequence:
|
||||||
type: sequence
|
type: sequence
|
||||||
glob:
|
glob:
|
||||||
- src/b_main.cc
|
- src/b_main.cpp
|
||||||
combine_free_functions_into_file_participants: true
|
combine_free_functions_into_file_participants: true
|
||||||
using_namespace:
|
using_namespace:
|
||||||
- std
|
- std
|
||||||
|
@@ -85,7 +85,7 @@ add_subdirectory(lib/Files)
|
|||||||
add_subdirectory(config)
|
add_subdirectory(config)
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
add_subdirectory(sample)
|
add_subdirectory(sample)
|
||||||
file(GLOB Platform_SOURCES CONFIGURE_DEPENDS ${Platform_SOURCE_DIR}/src/*.cc)
|
file(GLOB Platform_SOURCES CONFIGURE_DEPENDS ${Platform_SOURCE_DIR}/src/*.cpp)
|
||||||
|
|
||||||
# Testing
|
# Testing
|
||||||
# -------
|
# -------
|
||||||
|
4
Doxyfile
4
Doxyfile
@@ -976,7 +976,7 @@ INPUT_FILE_ENCODING =
|
|||||||
# Note the list of default checked file patterns might differ from the list of
|
# Note the list of default checked file patterns might differ from the list of
|
||||||
# default file extension mappings.
|
# default file extension mappings.
|
||||||
#
|
#
|
||||||
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
|
# If left blank the following patterns are tested:*.c, *.cpp, *.cxx, *.cpp,
|
||||||
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
|
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
|
||||||
# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml,
|
# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml,
|
||||||
# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C
|
# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C
|
||||||
@@ -984,7 +984,7 @@ INPUT_FILE_ENCODING =
|
|||||||
# *.vhdl, *.ucf, *.qsf and *.ice.
|
# *.vhdl, *.ucf, *.qsf and *.ice.
|
||||||
|
|
||||||
FILE_PATTERNS = *.c \
|
FILE_PATTERNS = *.c \
|
||||||
*.cc \
|
*.cpp \
|
||||||
*.cxx \
|
*.cxx \
|
||||||
*.cpp \
|
*.cpp \
|
||||||
*.c++ \
|
*.c++ \
|
||||||
|
@@ -10,5 +10,5 @@ include_directories(
|
|||||||
${CMAKE_BINARY_DIR}/configured_files/include
|
${CMAKE_BINARY_DIR}/configured_files/include
|
||||||
/usr/local/include
|
/usr/local/include
|
||||||
)
|
)
|
||||||
add_executable(PlatformSample sample.cc ${Platform_SOURCE_DIR}/src/main/Models.cc)
|
add_executable(PlatformSample sample.cpp ${Platform_SOURCE_DIR}/src/main/Models.cpp)
|
||||||
target_link_libraries(PlatformSample "${PyClassifiers}" "${BayesNet}" ArffFiles mdlp ${Python3_LIBRARIES} "${TORCH_LIBRARIES}" ${LIBTORCH_PYTHON} Boost::python Boost::numpy)
|
target_link_libraries(PlatformSample "${PyClassifiers}" "${BayesNet}" ArffFiles mdlp ${Python3_LIBRARIES} "${TORCH_LIBRARIES}" ${LIBTORCH_PYTHON} Boost::python Boost::numpy)
|
@@ -16,37 +16,37 @@ include_directories(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# b_best
|
# b_best
|
||||||
set(best_sources b_best.cc BestResults.cc Statistics.cc BestResultsExcel.cc)
|
set(best_sources b_best.cpp BestResults.cpp Statistics.cpp BestResultsExcel.cpp)
|
||||||
list(TRANSFORM best_sources PREPEND best/)
|
list(TRANSFORM best_sources PREPEND best/)
|
||||||
add_executable(
|
add_executable(
|
||||||
b_best ${best_sources} main/Result.cc
|
b_best ${best_sources} main/Result.cpp
|
||||||
reports/ReportExcel.cc reports/ReportBase.cc reports/ExcelFile.cc common/Datasets.cc common/Dataset.cc main/Models.cc)
|
reports/ReportExcel.cpp reports/ReportBase.cpp reports/ExcelFile.cpp common/Datasets.cpp common/Dataset.cpp main/Models.cpp)
|
||||||
target_link_libraries(b_best Boost::boost "${PyClassifiers}" "${BayesNet}" ArffFiles mdlp ${Python3_LIBRARIES} "${TORCH_LIBRARIES}" ${LIBTORCH_PYTHON} Boost::python Boost::numpy "${XLSXWRITER_LIB}")
|
target_link_libraries(b_best Boost::boost "${PyClassifiers}" "${BayesNet}" ArffFiles mdlp ${Python3_LIBRARIES} "${TORCH_LIBRARIES}" ${LIBTORCH_PYTHON} Boost::python Boost::numpy "${XLSXWRITER_LIB}")
|
||||||
|
|
||||||
# b_grid
|
# b_grid
|
||||||
set(grid_sources b_grid.cc GridSearch.cc GridData.cc)
|
set(grid_sources b_grid.cpp GridSearch.cpp GridData.cpp)
|
||||||
list(TRANSFORM grid_sources PREPEND grid/)
|
list(TRANSFORM grid_sources PREPEND grid/)
|
||||||
add_executable(b_grid ${grid_sources} main/HyperParameters.cc main/Models.cc common/Datasets.cc common/Dataset.cc)
|
add_executable(b_grid ${grid_sources} main/HyperParameters.cpp main/Models.cpp common/Datasets.cpp common/Dataset.cpp)
|
||||||
target_link_libraries(b_grid ${MPI_CXX_LIBRARIES} "${PyClassifiers}" "${BayesNet}" ArffFiles mdlp ${Python3_LIBRARIES} "${TORCH_LIBRARIES}" ${LIBTORCH_PYTHON} Boost::python Boost::numpy)
|
target_link_libraries(b_grid ${MPI_CXX_LIBRARIES} "${PyClassifiers}" "${BayesNet}" ArffFiles mdlp ${Python3_LIBRARIES} "${TORCH_LIBRARIES}" ${LIBTORCH_PYTHON} Boost::python Boost::numpy)
|
||||||
|
|
||||||
# b_list
|
# b_list
|
||||||
set(list_sources b_list.cc DatasetsExcel.cc)
|
set(list_sources b_list.cpp DatasetsExcel.cpp)
|
||||||
list(TRANSFORM list_sources PREPEND list/)
|
list(TRANSFORM list_sources PREPEND list/)
|
||||||
add_executable(b_list ${list_sources} common/Datasets.cc common/Dataset.cc reports/ReportExcel.cc reports/ExcelFile.cc reports/ReportBase.cc)
|
add_executable(b_list ${list_sources} common/Datasets.cpp common/Dataset.cpp reports/ReportExcel.cpp reports/ExcelFile.cpp reports/ReportBase.cpp)
|
||||||
target_link_libraries(b_list "${TORCH_LIBRARIES}" "${XLSXWRITER_LIB}" ArffFiles mdlp)
|
target_link_libraries(b_list "${TORCH_LIBRARIES}" "${XLSXWRITER_LIB}" ArffFiles mdlp)
|
||||||
|
|
||||||
# b_main
|
# b_main
|
||||||
set(main_sources b_main.cc Experiment.cc Models.cc HyperParameters.cc)
|
set(main_sources b_main.cpp Experiment.cpp Models.cpp HyperParameters.cpp)
|
||||||
list(TRANSFORM main_sources PREPEND main/)
|
list(TRANSFORM main_sources PREPEND main/)
|
||||||
add_executable(b_main ${main_sources} common/Datasets.cc common/Dataset.cc reports/ReportConsole.cc reports/ReportBase.cc main/Result.cc)
|
add_executable(b_main ${main_sources} common/Datasets.cpp common/Dataset.cpp reports/ReportConsole.cpp reports/ReportBase.cpp main/Result.cpp)
|
||||||
target_link_libraries(b_main "${PyClassifiers}" "${BayesNet}" ArffFiles mdlp ${Python3_LIBRARIES} "${TORCH_LIBRARIES}" ${LIBTORCH_PYTHON} Boost::python Boost::numpy)
|
target_link_libraries(b_main "${PyClassifiers}" "${BayesNet}" ArffFiles mdlp ${Python3_LIBRARIES} "${TORCH_LIBRARIES}" ${LIBTORCH_PYTHON} Boost::python Boost::numpy)
|
||||||
|
|
||||||
# b_manage
|
# b_manage
|
||||||
set(manage_sources b_manage.cc ManageResults.cc CommandParser.cc Results.cc)
|
set(manage_sources b_manage.cpp ManageResults.cpp CommandParser.cpp ResultsManager.cpp)
|
||||||
list(TRANSFORM manage_sources PREPEND manage/)
|
list(TRANSFORM manage_sources PREPEND manage/)
|
||||||
add_executable(
|
add_executable(
|
||||||
b_manage ${manage_sources} main/Result.cc
|
b_manage ${manage_sources} main/Result.cpp
|
||||||
reports/ReportConsole.cc reports/ReportExcel.cc reports/ReportExcelCompared.cc reports/ReportBase.cc reports/ExcelFile.cc
|
reports/ReportConsole.cpp reports/ReportExcel.cpp reports/ReportExcelCompared.cpp reports/ReportBase.cpp reports/ExcelFile.cpp
|
||||||
common/Datasets.cc common/Dataset.cc
|
common/Datasets.cpp common/Dataset.cpp
|
||||||
)
|
)
|
||||||
target_link_libraries(b_manage "${TORCH_LIBRARIES}" "${XLSXWRITER_LIB}" ArffFiles mdlp)
|
target_link_libraries(b_manage "${TORCH_LIBRARIES}" "${XLSXWRITER_LIB}" ArffFiles mdlp)
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef BESTRESULTS_H
|
#pragma once
|
||||||
#define BESTRESULTS_H
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
using json = nlohmann::json;
|
using json = nlohmann::json;
|
||||||
@@ -34,4 +34,3 @@ namespace platform {
|
|||||||
int maxDatasetName = 0;
|
int maxDatasetName = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif //BESTRESULTS_H
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef BESTRESULTS_EXCEL_H
|
#pragma once
|
||||||
#define BESTRESULTS_EXCEL_H
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
@@ -34,4 +34,3 @@ namespace platform {
|
|||||||
int datasetNameSize = 25; // Min size of the column
|
int datasetNameSize = 25; // Min size of the column
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif //BESTRESULTS_EXCEL_H
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef BESTSCORE_H
|
#pragma once
|
||||||
#define BESTSCORE_H
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@@ -24,5 +24,3 @@ namespace platform {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef STATISTICS_H
|
#pragma once
|
||||||
#define STATISTICS_H
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
@@ -60,4 +60,3 @@ namespace platform {
|
|||||||
std::map<std::string, std::map<std::string, float>> ranksModels;
|
std::map<std::string, std::map<std::string, float>> ranksModels;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif // !STATISTICS_H
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LOCALE_H
|
#pragma once
|
||||||
#define LOCALE_H
|
|
||||||
#include <locale>
|
#include <locale>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -19,4 +19,3 @@ namespace platform {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef COLORS_H
|
#pragma once
|
||||||
#define COLORS_H
|
|
||||||
#include <string>
|
#include <string>
|
||||||
class Colors {
|
class Colors {
|
||||||
public:
|
public:
|
||||||
@@ -13,4 +13,3 @@ public:
|
|||||||
static std::string IBLUE() { return "\033[0;94m"; }
|
static std::string IBLUE() { return "\033[0;94m"; }
|
||||||
static std::string RESET() { return "\033[0m"; }
|
static std::string RESET() { return "\033[0m"; }
|
||||||
};
|
};
|
||||||
#endif // COLORS_H
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef DATASET_H
|
#pragma once
|
||||||
#define DATASET_H
|
|
||||||
#include <torch/torch.h>
|
#include <torch/torch.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -75,4 +75,3 @@ namespace platform {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef DATASETS_H
|
#pragma once
|
||||||
#define DATASETS_H
|
|
||||||
#include "Dataset.h"
|
#include "Dataset.h"
|
||||||
namespace platform {
|
namespace platform {
|
||||||
class Datasets {
|
class Datasets {
|
||||||
@@ -27,5 +27,3 @@ namespace platform {
|
|||||||
std::string toString() const;
|
std::string toString() const;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef DOTENV_H
|
#pragma once
|
||||||
#define DOTENV_H
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
@@ -52,4 +52,3 @@ namespace platform {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef PATHS_H
|
#pragma once
|
||||||
#define PATHS_H
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include "DotEnv.h"
|
#include "DotEnv.h"
|
||||||
@@ -36,4 +36,3 @@ namespace platform {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef SYMBOLS_H
|
#pragma once
|
||||||
#define SYMBOLS_H
|
|
||||||
#include <string>
|
#include <string>
|
||||||
namespace platform {
|
namespace platform {
|
||||||
class Symbols {
|
class Symbols {
|
||||||
@@ -15,4 +15,3 @@ namespace platform {
|
|||||||
inline static const std::string notebook{ "\U0001F5C8" };
|
inline static const std::string notebook{ "\U0001F5C8" };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif // !SYMBOLS_H
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef TIMER_H
|
#pragma once
|
||||||
#define TIMER_H
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@@ -40,4 +40,3 @@ namespace platform {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
} /* namespace platform */
|
} /* namespace platform */
|
||||||
#endif /* TIMER_H */
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef UTILS_H
|
#pragma once
|
||||||
#define UTILS_H
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -27,4 +27,3 @@ namespace platform {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef GRIDDATA_H
|
#pragma once
|
||||||
#define GRIDDATA_H
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
@@ -23,4 +23,3 @@ namespace platform {
|
|||||||
std::map<std::string, json> grid;
|
std::map<std::string, json> grid;
|
||||||
};
|
};
|
||||||
} /* namespace platform */
|
} /* namespace platform */
|
||||||
#endif /* GRIDDATA_H */
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef GRIDSEARCH_H
|
#pragma once
|
||||||
#define GRIDSEARCH_H
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <mpi.h>
|
#include <mpi.h>
|
||||||
@@ -57,4 +57,3 @@ namespace platform {
|
|||||||
Timer timer; // used to measure the time of the whole process
|
Timer timer; // used to measure the time of the whole process
|
||||||
};
|
};
|
||||||
} /* namespace platform */
|
} /* namespace platform */
|
||||||
#endif /* GRIDSEARCH_H */
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef DATASETS_EXCEL_H
|
#pragma once
|
||||||
#define DATASETS_EXCEL_H
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
@@ -16,4 +16,3 @@ namespace platform {
|
|||||||
void report(json& data);
|
void report(json& data);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif //DATASETS_EXCEL_H
|
|
@@ -75,6 +75,9 @@ void list_datasets(argparse::ArgumentParser& program)
|
|||||||
void list_results(argparse::ArgumentParser& program)
|
void list_results(argparse::ArgumentParser& program)
|
||||||
{
|
{
|
||||||
std::cout << "Results" << std::endl;
|
std::cout << "Results" << std::endl;
|
||||||
|
auto dataset = program.get<string>("--dataset");
|
||||||
|
auto score = program.get<string>("--score");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
@@ -107,6 +110,7 @@ int main(int argc, char** argv)
|
|||||||
throw std::runtime_error("Dataset must be one of " + datasets.toString());
|
throw std::runtime_error("Dataset must be one of " + datasets.toString());
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
program.add_argument("-s", "--score").default_value("accuracy").help("Filter results of the score name supplied");
|
||||||
// Add subparsers
|
// Add subparsers
|
||||||
program.add_subparser(datasets_command);
|
program.add_subparser(datasets_command);
|
||||||
program.add_subparser(results_command);
|
program.add_subparser(results_command);
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef EXPERIMENT_H
|
#pragma once
|
||||||
#define EXPERIMENT_H
|
|
||||||
#include <torch/torch.h>
|
#include <torch/torch.h>
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -43,4 +43,3 @@ namespace platform {
|
|||||||
int max_name{ 7 }; // max length of dataset name for formatting (default 7)
|
int max_name{ 7 }; // max length of dataset name for formatting (default 7)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef HYPERPARAMETERS_H
|
#pragma once
|
||||||
#define HYPERPARAMETERS_H
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -20,4 +20,3 @@ namespace platform {
|
|||||||
std::map<std::string, json> hyperparameters;
|
std::map<std::string, json> hyperparameters;
|
||||||
};
|
};
|
||||||
} /* namespace platform */
|
} /* namespace platform */
|
||||||
#endif /* HYPERPARAMETERS_H */
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef MODELS_H
|
#pragma once
|
||||||
#define MODELS_H
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <bayesnet/BaseClassifier.h>
|
#include <bayesnet/BaseClassifier.h>
|
||||||
#include <bayesnet/ensembles/AODE.h>
|
#include <bayesnet/ensembles/AODE.h>
|
||||||
@@ -39,4 +39,3 @@ namespace platform {
|
|||||||
Registrar(const std::string& className, function<bayesnet::BaseClassifier* (void)> classFactoryFunction);
|
Registrar(const std::string& className, function<bayesnet::BaseClassifier* (void)> classFactoryFunction);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef RESULT_H
|
#pragma once
|
||||||
#define RESULT_H
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -48,4 +48,3 @@ namespace platform {
|
|||||||
double score = 0.0;
|
double score = 0.0;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
#endif
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef MODEL_REGISTER_H
|
#pragma once
|
||||||
#define MODEL_REGISTER_H
|
|
||||||
static platform::Registrar registrarT("TAN",
|
static platform::Registrar registrarT("TAN",
|
||||||
[](void) -> bayesnet::BaseClassifier* { return new bayesnet::TAN();});
|
[](void) -> bayesnet::BaseClassifier* { return new bayesnet::TAN();});
|
||||||
static platform::Registrar registrarTLD("TANLd",
|
static platform::Registrar registrarTLD("TANLd",
|
||||||
@@ -28,4 +28,3 @@ static platform::Registrar registrarRaF("RandomForest",
|
|||||||
[](void) -> bayesnet::BaseClassifier* { return new pywrap::RandomForest();});
|
[](void) -> bayesnet::BaseClassifier* { return new pywrap::RandomForest();});
|
||||||
static platform::Registrar registrarXGB("XGBoost",
|
static platform::Registrar registrarXGB("XGBoost",
|
||||||
[](void) -> bayesnet::BaseClassifier* { return new pywrap::XGBoost();});
|
[](void) -> bayesnet::BaseClassifier* { return new pywrap::XGBoost();});
|
||||||
#endif
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef COMMAND_PARSER_H
|
#pragma once
|
||||||
#define COMMAND_PARSER_H
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
@@ -17,4 +17,3 @@ namespace platform {
|
|||||||
int index;
|
int index;
|
||||||
};
|
};
|
||||||
} /* namespace platform */
|
} /* namespace platform */
|
||||||
#endif /* COMMAND_PARSER_H */
|
|
@@ -12,7 +12,7 @@
|
|||||||
namespace platform {
|
namespace platform {
|
||||||
|
|
||||||
ManageResults::ManageResults(int numFiles, const std::string& model, const std::string& score, bool complete, bool partial, bool compare) :
|
ManageResults::ManageResults(int numFiles, const std::string& model, const std::string& score, bool complete, bool partial, bool compare) :
|
||||||
numFiles{ numFiles }, complete{ complete }, partial{ partial }, compare{ compare }, results(Results(Paths::results(), model, score, complete, partial))
|
numFiles{ numFiles }, complete{ complete }, partial{ partial }, compare{ compare }, results(ResultsManager(model, score, complete, partial))
|
||||||
{
|
{
|
||||||
indexList = true;
|
indexList = true;
|
||||||
openExcel = false;
|
openExcel = false;
|
@@ -1,7 +1,7 @@
|
|||||||
#ifndef MANAGE_RESULTS_H
|
#pragma once
|
||||||
#define MANAGE_RESULTS_H
|
|
||||||
#include <xlsxwriter.h>
|
#include <xlsxwriter.h>
|
||||||
#include "Results.h"
|
#include "ResultsManager.h"
|
||||||
|
|
||||||
namespace platform {
|
namespace platform {
|
||||||
class ManageResults {
|
class ManageResults {
|
||||||
@@ -23,9 +23,7 @@ namespace platform {
|
|||||||
bool complete;
|
bool complete;
|
||||||
bool partial;
|
bool partial;
|
||||||
bool compare;
|
bool compare;
|
||||||
Results results;
|
ResultsManager results;
|
||||||
lxw_workbook* workbook;
|
lxw_workbook* workbook;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* MANAGE_RESULTS_H */
|
|
@@ -1,9 +1,10 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "Results.h"
|
#include "common/Paths.h"
|
||||||
|
#include "ResultsManager.h"
|
||||||
|
|
||||||
namespace platform {
|
namespace platform {
|
||||||
Results::Results(const std::string& path, const std::string& model, const std::string& score, bool complete, bool partial) :
|
ResultsManager::ResultsManager(const std::string& model, const std::string& score, bool complete, bool partial) :
|
||||||
path(path), model(model), scoreName(score), complete(complete), partial(partial)
|
path(Paths::results()), model(model), scoreName(score), complete(complete), partial(partial)
|
||||||
{
|
{
|
||||||
load();
|
load();
|
||||||
if (!files.empty()) {
|
if (!files.empty()) {
|
||||||
@@ -12,7 +13,7 @@ namespace platform {
|
|||||||
maxModel = 0;
|
maxModel = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void Results::load()
|
void ResultsManager::load()
|
||||||
{
|
{
|
||||||
using std::filesystem::directory_iterator;
|
using std::filesystem::directory_iterator;
|
||||||
for (const auto& file : directory_iterator(path)) {
|
for (const auto& file : directory_iterator(path)) {
|
||||||
@@ -28,47 +29,47 @@ namespace platform {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void Results::hideResult(int index, const std::string& pathHidden)
|
void ResultsManager::hideResult(int index, const std::string& pathHidden)
|
||||||
{
|
{
|
||||||
auto filename = files.at(index).getFilename();
|
auto filename = files.at(index).getFilename();
|
||||||
rename((path + "/" + filename).c_str(), (pathHidden + "/" + filename).c_str());
|
rename((path + "/" + filename).c_str(), (pathHidden + "/" + filename).c_str());
|
||||||
files.erase(files.begin() + index);
|
files.erase(files.begin() + index);
|
||||||
}
|
}
|
||||||
void Results::deleteResult(int index)
|
void ResultsManager::deleteResult(int index)
|
||||||
{
|
{
|
||||||
auto filename = files.at(index).getFilename();
|
auto filename = files.at(index).getFilename();
|
||||||
remove((path + "/" + filename).c_str());
|
remove((path + "/" + filename).c_str());
|
||||||
files.erase(files.begin() + index);
|
files.erase(files.begin() + index);
|
||||||
}
|
}
|
||||||
int Results::size() const
|
int ResultsManager::size() const
|
||||||
{
|
{
|
||||||
return files.size();
|
return files.size();
|
||||||
}
|
}
|
||||||
void Results::sortDate()
|
void ResultsManager::sortDate()
|
||||||
{
|
{
|
||||||
sort(files.begin(), files.end(), [](const Result& a, const Result& b) {
|
sort(files.begin(), files.end(), [](const Result& a, const Result& b) {
|
||||||
return a.getDate() > b.getDate();
|
return a.getDate() > b.getDate();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void Results::sortModel()
|
void ResultsManager::sortModel()
|
||||||
{
|
{
|
||||||
sort(files.begin(), files.end(), [](const Result& a, const Result& b) {
|
sort(files.begin(), files.end(), [](const Result& a, const Result& b) {
|
||||||
return a.getModel() > b.getModel();
|
return a.getModel() > b.getModel();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void Results::sortDuration()
|
void ResultsManager::sortDuration()
|
||||||
{
|
{
|
||||||
sort(files.begin(), files.end(), [](const Result& a, const Result& b) {
|
sort(files.begin(), files.end(), [](const Result& a, const Result& b) {
|
||||||
return a.getDuration() > b.getDuration();
|
return a.getDuration() > b.getDuration();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void Results::sortScore()
|
void ResultsManager::sortScore()
|
||||||
{
|
{
|
||||||
sort(files.begin(), files.end(), [](const Result& a, const Result& b) {
|
sort(files.begin(), files.end(), [](const Result& a, const Result& b) {
|
||||||
return a.getScore() > b.getScore();
|
return a.getScore() > b.getScore();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
bool Results::empty() const
|
bool ResultsManager::empty() const
|
||||||
{
|
{
|
||||||
return files.empty();
|
return files.empty();
|
||||||
}
|
}
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef RESULTS_H
|
#pragma once
|
||||||
#define RESULTS_H
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -7,9 +7,9 @@
|
|||||||
#include "main/Result.h"
|
#include "main/Result.h"
|
||||||
namespace platform {
|
namespace platform {
|
||||||
using json = nlohmann::json;
|
using json = nlohmann::json;
|
||||||
class Results {
|
class ResultsManager {
|
||||||
public:
|
public:
|
||||||
Results(const std::string& path, const std::string& model, const std::string& score, bool complete, bool partial);
|
ResultsManager(const std::string& model, const std::string& score, bool complete, bool partial);
|
||||||
void sortDate();
|
void sortDate();
|
||||||
void sortScore();
|
void sortScore();
|
||||||
void sortModel();
|
void sortModel();
|
||||||
@@ -33,4 +33,3 @@ namespace platform {
|
|||||||
void load(); // Loads the list of results
|
void load(); // Loads the list of results
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
#endif
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef EXCELFILE_H
|
#pragma once
|
||||||
#define EXCELFILE_H
|
|
||||||
#include <locale>
|
#include <locale>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
@@ -42,4 +42,3 @@ namespace platform {
|
|||||||
void setDefault();
|
void setDefault();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif // !EXCELFILE_H
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef REPORTBASE_H
|
#pragma once
|
||||||
#define REPORTBASE_H
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
@@ -33,4 +33,3 @@ namespace platform {
|
|||||||
bool existBestFile = true;
|
bool existBestFile = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
#endif
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef REPORTCONSOLE_H
|
#pragma once
|
||||||
#define REPORTCONSOLE_H
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "common/Colors.h"
|
#include "common/Colors.h"
|
||||||
#include "ReportBase.h"
|
#include "ReportBase.h"
|
||||||
@@ -19,4 +19,3 @@ namespace platform {
|
|||||||
void showSummary() override;
|
void showSummary() override;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
#endif
|
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef REPORTEXCEL_H
|
#pragma once
|
||||||
#define REPORTEXCEL_H
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <xlsxwriter.h>
|
#include <xlsxwriter.h>
|
||||||
#include "common/Colors.h"
|
#include "common/Colors.h"
|
||||||
@@ -22,4 +22,3 @@ namespace platform {
|
|||||||
void header_notes(int row);
|
void header_notes(int row);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
#endif // !REPORTEXCEL_H
|
|
@@ -8,7 +8,7 @@ if(ENABLE_TESTING)
|
|||||||
${CMAKE_BINARY_DIR}/configured_files/include
|
${CMAKE_BINARY_DIR}/configured_files/include
|
||||||
/usr/local/include
|
/usr/local/include
|
||||||
)
|
)
|
||||||
set(TEST_SOURCES_PLATFORM TestUtils.cc TestPlatform.cc)
|
set(TEST_SOURCES_PLATFORM TestUtils.cpp TestPlatform.cpp)
|
||||||
add_executable(${TEST_PLATFORM} ${TEST_SOURCES_PLATFORM})
|
add_executable(${TEST_PLATFORM} ${TEST_SOURCES_PLATFORM})
|
||||||
target_link_libraries(${TEST_PLATFORM} PUBLIC "${TORCH_LIBRARIES}" ArffFiles mdlp Catch2::Catch2WithMain)
|
target_link_libraries(${TEST_PLATFORM} PUBLIC "${TORCH_LIBRARIES}" ArffFiles mdlp Catch2::Catch2WithMain)
|
||||||
add_test(NAME ${TEST_PLATFORM} COMMAND ${TEST_PLATFORM})
|
add_test(NAME ${TEST_PLATFORM} COMMAND ${TEST_PLATFORM})
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef TEST_UTILS_H
|
#pragma once
|
||||||
#define TEST_UTILS_H
|
|
||||||
#include <torch/torch.h>
|
#include <torch/torch.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -40,4 +40,3 @@ public:
|
|||||||
double epsilon = 1e-5;
|
double epsilon = 1e-5;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //TEST_UTILS_H
|
|
Reference in New Issue
Block a user