Refactor BestScore and add experiment to .env

This commit is contained in:
2023-10-23 16:12:52 +02:00
parent 7bcd2eed06
commit 1f705f6018
7 changed files with 38 additions and 18 deletions

View File

@@ -1,10 +1,28 @@
#ifndef BESTSCORE_H
#define BESTSCORE_H
#include <string>
class BestScore {
public:
static std::string title() { return "STree_default (linear-ovo)"; }
static double score() { return 22.109799; }
static std::string scoreName() { return "accuracy"; }
};
#include <map>
#include <utility>
#include "DotEnv.h"
namespace platform {
class BestScore {
public:
static pair<string, double> getScore(const std::string& metric)
{
static map<pair<string, string>, pair<string, double>> data = {
{{"discretiz", "accuracy"}, {"STree_default (linear-ovo)", 22.109799}},
//{{"odte", "accuracy"}, {"STree_default (linear-ovo)", 22.109799}},
};
auto env = platform::DotEnv();
string experiment = env.get("experiment");
try {
return data[{experiment, metric}];
}
catch (...) {
return { "", 0.0 };
}
}
};
}
#endif