moving changes
parent
5356be6649
commit
9fb3d78bca
|
@ -8,4 +8,3 @@ massif.*
|
||||||
callgrind.*
|
callgrind.*
|
||||||
*.out.*
|
*.out.*
|
||||||
heaptrack.*
|
heaptrack.*
|
||||||
Rice_Cammeo_Osmancik.arff
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ macro(compile_options target_name)
|
||||||
sanitizers(${target_name})
|
sanitizers(${target_name})
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
project(blt-gp VERSION 0.2.6)
|
project(blt-gp VERSION 0.2.7)
|
||||||
|
|
||||||
include(CTest)
|
include(CTest)
|
||||||
|
|
||||||
|
@ -103,16 +103,16 @@ endif ()
|
||||||
|
|
||||||
if (${BUILD_GP_TESTS})
|
if (${BUILD_GP_TESTS})
|
||||||
|
|
||||||
blt_add_project(blt-stack tests/stack_tests.cpp test)
|
blt_add_project(blt-stack tests/old/stack_tests.cpp test)
|
||||||
blt_add_project(blt-eval tests/evaluation_tests.cpp test)
|
blt_add_project(blt-eval tests/old/evaluation_tests.cpp test)
|
||||||
blt_add_project(blt-order tests/order_tests.cpp test)
|
blt_add_project(blt-order tests/old/order_tests.cpp test)
|
||||||
#blt_add_project(blt-destructor tests/destructor_test.cpp test)
|
#blt_add_project(blt-destructor tests/destructor_test.cpp test)
|
||||||
blt_add_project(blt-gp1 tests/gp_test_1.cpp test)
|
blt_add_project(blt-gp1 tests/old/gp_test_1.cpp test)
|
||||||
blt_add_project(blt-gp2 tests/gp_test_2.cpp test)
|
blt_add_project(blt-gp2 tests/old/gp_test_2.cpp test)
|
||||||
blt_add_project(blt-gp3 tests/gp_test_3.cpp test)
|
blt_add_project(blt-gp3 tests/old/gp_test_3.cpp test)
|
||||||
blt_add_project(blt-gp4 tests/gp_test_4.cpp test)
|
blt_add_project(blt-gp4 tests/old/gp_test_4.cpp test)
|
||||||
blt_add_project(blt-gp5 tests/gp_test_5.cpp test)
|
blt_add_project(blt-gp5 tests/old/gp_test_5.cpp test)
|
||||||
blt_add_project(blt-gp6 tests/gp_test_6.cpp test)
|
blt_add_project(blt-gp6 tests/old/gp_test_6.cpp test)
|
||||||
blt_add_project(blt-gp7 tests/gp_test_7.cpp test)
|
blt_add_project(blt-gp7 tests/old/gp_test_7.cpp test)
|
||||||
|
|
||||||
endif ()
|
endif ()
|
|
@ -43,3 +43,6 @@ const auto fitness_function = [](blt::gp::tree_t& current_tree, blt::gp::fitness
|
||||||
```
|
```
|
||||||
|
|
||||||
## Performance
|
## Performance
|
||||||
|
|
||||||
|
## Bibliography
|
||||||
|
Rice (Cammeo and Osmancik) [Dataset]. (2019). UCI Machine Learning Repository. https://doi.org/10.24432/C5MW4Z.
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -25,6 +25,7 @@
|
||||||
#include <blt/format/format.h>
|
#include <blt/format/format.h>
|
||||||
#include <blt/parse/argparse.h>
|
#include <blt/parse/argparse.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <filesystem>
|
||||||
#include "../rice_classification.h"
|
#include "../rice_classification.h"
|
||||||
#include "blt/fs/loader.h"
|
#include "blt/fs/loader.h"
|
||||||
|
|
||||||
|
@ -44,7 +45,8 @@ blt::gp::prog_config_t config = blt::gp::prog_config_t()
|
||||||
int main(int argc, const char** argv)
|
int main(int argc, const char** argv)
|
||||||
{
|
{
|
||||||
blt::arg_parse parser;
|
blt::arg_parse parser;
|
||||||
parser.addArgument(blt::arg_builder{"-f", "--file"}.setHelp("File for rice data. Should be in .arff format.").setRequired().build());
|
parser.addArgument(blt::arg_builder{"file"}
|
||||||
|
.setHelp("File for rice data. Should be in .arff format.").setDefault("../datasets/Rice_Cammeo_Osmancik.arff").build());
|
||||||
|
|
||||||
auto args = parser.parse_args(argc, argv);
|
auto args = parser.parse_args(argc, argv);
|
||||||
|
|
||||||
|
@ -144,6 +146,11 @@ bool blt::gp::example::rice_classification_t::fitness_function(const tree_t& cur
|
||||||
|
|
||||||
void blt::gp::example::rice_classification_t::load_rice_data(const std::string_view rice_file_path)
|
void blt::gp::example::rice_classification_t::load_rice_data(const std::string_view rice_file_path)
|
||||||
{
|
{
|
||||||
|
if (!std::filesystem::exists(rice_file_path))
|
||||||
|
{
|
||||||
|
BLT_WARN("Rice file not found!");
|
||||||
|
std::exit(0);
|
||||||
|
}
|
||||||
BLT_DEBUG("Setup Fitness cases");
|
BLT_DEBUG("Setup Fitness cases");
|
||||||
auto rice_file_data = fs::getLinesFromFile(rice_file_path);
|
auto rice_file_data = fs::getLinesFromFile(rice_file_path);
|
||||||
size_t index = 0;
|
size_t index = 0;
|
||||||
|
|
|
@ -352,7 +352,7 @@ namespace blt::gp
|
||||||
auto copy = c;
|
auto copy = c;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
auto result = copy.evaluate(nullptr);
|
const auto& result = copy.evaluate();
|
||||||
blt::black_box(result);
|
blt::black_box(result);
|
||||||
} catch (...)
|
} catch (...)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue