Compare commits
6 Commits
libxlsxwri
...
5fa0b957dd
Author | SHA1 | Date | |
---|---|---|---|
5fa0b957dd
|
|||
67252fc41d
|
|||
94ae9456a0
|
|||
781993e326
|
|||
8257a6ae39
|
|||
fc81730dfc |
@@ -54,6 +54,7 @@ endif (ENABLE_CLANG_TIDY)
|
|||||||
add_git_submodule("lib/mdlp")
|
add_git_submodule("lib/mdlp")
|
||||||
add_git_submodule("lib/argparse")
|
add_git_submodule("lib/argparse")
|
||||||
add_git_submodule("lib/json")
|
add_git_submodule("lib/json")
|
||||||
|
find_library(XLSXWRITER_LIB libxlsxwriter.dylib PATHS /usr/local/lib)
|
||||||
|
|
||||||
# Subdirectories
|
# Subdirectories
|
||||||
# --------------
|
# --------------
|
||||||
|
@@ -4,6 +4,7 @@ include_directories(${BayesNet_SOURCE_DIR}/lib/Files)
|
|||||||
include_directories(${BayesNet_SOURCE_DIR}/lib/mdlp)
|
include_directories(${BayesNet_SOURCE_DIR}/lib/mdlp)
|
||||||
include_directories(${BayesNet_SOURCE_DIR}/lib/argparse/include)
|
include_directories(${BayesNet_SOURCE_DIR}/lib/argparse/include)
|
||||||
include_directories(${BayesNet_SOURCE_DIR}/lib/json/include)
|
include_directories(${BayesNet_SOURCE_DIR}/lib/json/include)
|
||||||
|
include_directories(${BayesNet_SOURCE_DIR}/lib/libxlsxwriter/include)
|
||||||
add_executable(main main.cc Folding.cc platformUtils.cc Experiment.cc Datasets.cc Models.cc ReportConsole.cc ReportBase.cc)
|
add_executable(main main.cc Folding.cc platformUtils.cc Experiment.cc Datasets.cc Models.cc ReportConsole.cc ReportBase.cc)
|
||||||
add_executable(manage manage.cc Results.cc ReportConsole.cc ReportExcel.cc ReportBase.cc Datasets.cc platformUtils.cc)
|
add_executable(manage manage.cc Results.cc ReportConsole.cc ReportExcel.cc ReportBase.cc Datasets.cc platformUtils.cc)
|
||||||
add_executable(list list.cc platformUtils Datasets.cc)
|
add_executable(list list.cc platformUtils Datasets.cc)
|
||||||
@@ -11,6 +12,6 @@ target_link_libraries(main BayesNet ArffFiles mdlp "${TORCH_LIBRARIES}")
|
|||||||
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux")
|
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux")
|
||||||
target_link_libraries(manage "${TORCH_LIBRARIES}" libxlsxwriter.so ArffFiles mdlp stdc++fs)
|
target_link_libraries(manage "${TORCH_LIBRARIES}" libxlsxwriter.so ArffFiles mdlp stdc++fs)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(manage "${TORCH_LIBRARIES}" libxlsxwriter.so ArffFiles mdlp)
|
target_link_libraries(manage "${TORCH_LIBRARIES}" "${XLSXWRITER_LIB}" ArffFiles mdlp)
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(list ArffFiles mdlp "${TORCH_LIBRARIES}")
|
target_link_libraries(list ArffFiles mdlp "${TORCH_LIBRARIES}")
|
@@ -94,6 +94,8 @@ namespace platform {
|
|||||||
ifstream resultData(Paths::results() + "/" + fileName);
|
ifstream resultData(Paths::results() + "/" + fileName);
|
||||||
if (resultData.is_open()) {
|
if (resultData.is_open()) {
|
||||||
bestResults = json::parse(resultData);
|
bestResults = json::parse(resultData);
|
||||||
|
} else {
|
||||||
|
existBestFile = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -101,7 +103,12 @@ namespace platform {
|
|||||||
}
|
}
|
||||||
catch (exception) {
|
catch (exception) {
|
||||||
value = 1.0;
|
value = 1.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
bool ReportBase::getExistBestFile()
|
||||||
|
{
|
||||||
|
return existBestFile;
|
||||||
|
}
|
||||||
}
|
}
|
@@ -28,6 +28,7 @@ namespace platform {
|
|||||||
json data;
|
json data;
|
||||||
string fromVector(const string& key);
|
string fromVector(const string& key);
|
||||||
string fVector(const string& title, const json& data, const int width, const int precision);
|
string fVector(const string& title, const json& data, const int width, const int precision);
|
||||||
|
bool getExistBestFile();
|
||||||
virtual void header() = 0;
|
virtual void header() = 0;
|
||||||
virtual void body() = 0;
|
virtual void body() = 0;
|
||||||
virtual void showSummary() = 0;
|
virtual void showSummary() = 0;
|
||||||
@@ -35,10 +36,11 @@ namespace platform {
|
|||||||
map<string, int> summary;
|
map<string, int> summary;
|
||||||
double margin;
|
double margin;
|
||||||
map<string, string> meaning;
|
map<string, string> meaning;
|
||||||
|
bool compare;
|
||||||
private:
|
private:
|
||||||
double bestResult(const string& dataset, const string& model);
|
double bestResult(const string& dataset, const string& model);
|
||||||
bool compare;
|
|
||||||
json bestResults;
|
json bestResults;
|
||||||
|
bool existBestFile = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
@@ -104,6 +104,9 @@ namespace platform {
|
|||||||
oss << score << " compared to " << BestResult::title() << " .: " << totalScore / BestResult::score();
|
oss << score << " compared to " << BestResult::title() << " .: " << totalScore / BestResult::score();
|
||||||
cout << headerLine(oss.str());
|
cout << headerLine(oss.str());
|
||||||
}
|
}
|
||||||
|
if (!getExistBestFile() && compare) {
|
||||||
|
cout << headerLine("*** Best Results File not found. Couldn't compare any result!");
|
||||||
|
}
|
||||||
cout << string(MAXL, '*') << endl << Colors::RESET();
|
cout << string(MAXL, '*') << endl << Colors::RESET();
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -18,7 +18,7 @@ namespace platform {
|
|||||||
void header() override;
|
void header() override;
|
||||||
void body() override;
|
void body() override;
|
||||||
void footer(double totalScore);
|
void footer(double totalScore);
|
||||||
void showSummary();
|
void showSummary() override;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
@@ -162,11 +162,11 @@ namespace platform {
|
|||||||
strcpy(line, data["title"].get<string>().c_str());
|
strcpy(line, data["title"].get<string>().c_str());
|
||||||
lxw_doc_properties properties = {
|
lxw_doc_properties properties = {
|
||||||
.title = line,
|
.title = line,
|
||||||
.subject = "Machine learning results",
|
.subject = (char*)"Machine learning results",
|
||||||
.author = "Ricardo Montañana Gómez",
|
.author = (char*)"Ricardo Montañana Gómez",
|
||||||
.manager = "Dr. J. A. Gámez, Dr. J. M. Puerta",
|
.manager = (char*)"Dr. J. A. Gámez, Dr. J. M. Puerta",
|
||||||
.company = "UCLM",
|
.company = (char*)"UCLM",
|
||||||
.comments = "Created with libxlsxwriter and c++",
|
.comments = (char*)"Created with libxlsxwriter and c++",
|
||||||
};
|
};
|
||||||
workbook_set_properties(workbook, &properties);
|
workbook_set_properties(workbook, &properties);
|
||||||
}
|
}
|
||||||
@@ -326,5 +326,8 @@ namespace platform {
|
|||||||
worksheet_merge_range(worksheet, row, 1, row, 5, (score + " compared to " + BestResult::title() + " .:").c_str(), efectiveStyle("text"));
|
worksheet_merge_range(worksheet, row, 1, row, 5, (score + " compared to " + BestResult::title() + " .:").c_str(), efectiveStyle("text"));
|
||||||
writeDouble(row, 6, totalScore / BestResult::score(), "result");
|
writeDouble(row, 6, totalScore / BestResult::score(), "result");
|
||||||
}
|
}
|
||||||
|
if (!getExistBestFile() && compare) {
|
||||||
|
worksheet_write_string(worksheet, row + 1, 0, "*** Best Results File not found. Couldn't compare any result!", styles["summaryStyle"]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -21,7 +21,6 @@ namespace platform {
|
|||||||
void setProperties();
|
void setProperties();
|
||||||
void createFile();
|
void createFile();
|
||||||
void closeFile();
|
void closeFile();
|
||||||
void showSummary();
|
|
||||||
lxw_workbook* workbook;
|
lxw_workbook* workbook;
|
||||||
lxw_worksheet* worksheet;
|
lxw_worksheet* worksheet;
|
||||||
map<string, lxw_format*> styles;
|
map<string, lxw_format*> styles;
|
||||||
@@ -33,6 +32,7 @@ namespace platform {
|
|||||||
const string fileName = "some_results.xlsx";
|
const string fileName = "some_results.xlsx";
|
||||||
void header() override;
|
void header() override;
|
||||||
void body() override;
|
void body() override;
|
||||||
|
void showSummary() override;
|
||||||
void footer(double totalScore, int row);
|
void footer(double totalScore, int row);
|
||||||
void createStyle(const string& name, lxw_format* style, bool odd);
|
void createStyle(const string& name, lxw_format* style, bool odd);
|
||||||
void addColor(lxw_format* style, bool odd);
|
void addColor(lxw_format* style, bool odd);
|
||||||
|
@@ -48,6 +48,9 @@ namespace platform {
|
|||||||
files.push_back(result);
|
files.push_back(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (max == 0) {
|
||||||
|
max = files.size();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
string Result::to_string() const
|
string Result::to_string() const
|
||||||
{
|
{
|
||||||
@@ -164,7 +167,7 @@ namespace platform {
|
|||||||
if (indexList) {
|
if (indexList) {
|
||||||
// The value is about the files list
|
// The value is about the files list
|
||||||
index = idx;
|
index = idx;
|
||||||
if (index >= 0 && index < files.size()) {
|
if (index >= 0 && index < max) {
|
||||||
report(index, false);
|
report(index, false);
|
||||||
indexList = false;
|
indexList = false;
|
||||||
continue;
|
continue;
|
||||||
@@ -300,7 +303,7 @@ namespace platform {
|
|||||||
if (openExcel) {
|
if (openExcel) {
|
||||||
workbook_close(workbook);
|
workbook_close(workbook);
|
||||||
}
|
}
|
||||||
cout << "Done!" << endl;
|
cout << Colors::RESET() << "Done!" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user