Update models versions

This commit is contained in:
2024-06-13 12:30:31 +02:00
parent e628d80f4c
commit 3d900f8c81
10 changed files with 60 additions and 35 deletions

View File

@@ -5,6 +5,14 @@
namespace platform {
using json = nlohmann::ordered_json;
const std::string message_dataset_not_loaded = "dataset not loaded.";
Datasets::Datasets(bool discretize, std::string sfileType, std::string discretizer_algorithm) :
discretize(discretize), sfileType(sfileType), discretizer_algorithm(discretizer_algorithm)
{
if (discretizer_algorithm == "none" && discretize) {
throw std::runtime_error("Can't discretize without discretization algorithm");
}
load();
}
void Datasets::load()
{
auto sd = SourceData(sfileType);

View File

@@ -4,14 +4,7 @@
namespace platform {
class Datasets {
public:
explicit Datasets(bool discretize, std::string sfileType, std::string discretizer_algorithm = "none") :
discretize(discretize), sfileType(sfileType), discretizer_algorithm(discretizer_algorithm)
{
if (discretizer_algorithm == "none" && discretize) {
throw std::runtime_error("Can't discretize without discretization algorithm");
}
load();
};
explicit Datasets(bool discretize, std::string sfileType, std::string discretizer_algorithm = "none");
std::vector<std::string> getNames();
bool isDataset(const std::string& name) const;
Dataset& getDataset(const std::string& name) const { return *datasets.at(name); }

View File

@@ -19,8 +19,8 @@ namespace platform {
{
valid =
{
{"source_data", {"Arff", "Tanveer", "Surcov"}},
{"experiment", {"discretiz", "odte", "covid"}},
{"source_data", {"Arff", "Tanveer", "Surcov", "Test"}},
{"experiment", {"discretiz", "odte", "covid", "Test"}},
{"fit_features", {"0", "1"}},
{"discretize", {"0", "1"}},
{"ignore_nan", {"0", "1"}},
@@ -31,7 +31,7 @@ namespace platform {
{"n_folds", {"5", "10"}},
{"discretize_algo", {"mdlp", "bin3u", "bin3q", "bin4u", "bin4q"}},
{"smooth_strat", {"OLD_LAPLACE", "LAPLACE", "CESTNIK"}},
{ "platform", {"any"} },
{"platform", {"any"}},
{"model", {"any"}},
{"seeds", {"any"}},
{"nodes", {"any"}},
@@ -41,8 +41,25 @@ namespace platform {
if (create) {
// For testing purposes
std::ofstream file(".env");
file << "source_data = Test" << std::endl;
file << "margin = 0.1" << std::endl;
file << "experiment=Test" << std::endl;
file << "source_data=Test" << std::endl;
file << "margin=0.1" << std::endl;
file << "score=accuracy" << std::endl;
file << "platform=um790Linux" << std::endl;
file << "n_folds=5" << std::endl;
file << "discretize_algo=mdlp" << std::endl;
file << "smooth_strat=OLD_LAPLACE" << std::endl;
file << "stratified=0" << std::endl;
file << "model=TAN" << std::endl;
file << "seeds=[271]" << std::endl;
file << "discretize=0" << std::endl;
file << "ignore_nan=0" << std::endl;
file << "nodes=Nodes" << std::endl;
file << "leaves=Edges" << std::endl;
file << "depth=States" << std::endl;
file << "fit_features=0" << std::endl;
file << "framework=bulma" << std::endl;
file << "margin=0.1" << std::endl;
file.close();
}
std::ifstream file(".env");