Fix Experiment

This commit is contained in:
2023-07-26 14:11:49 +02:00
parent af7a1d2b40
commit 49a49a9dcd
2 changed files with 26 additions and 16 deletions

View File

@@ -17,7 +17,7 @@ class Result {
private:
string dataset, hyperparameters;
int samples, features, classes;
float score, score_std, train_time, train_time_std, test_time, test_time_std;
float score_train, score_test, score_train_std, score_test_std, train_time, train_time_std, test_time, test_time_std;
public:
Result() = default;
Result& setDataset(string dataset) { this->dataset = dataset; return *this; }
@@ -25,12 +25,16 @@ public:
Result& setSamples(int samples) { this->samples = samples; return *this; }
Result& setFeatures(int features) { this->features = features; return *this; }
Result& setClasses(int classes) { this->classes = classes; return *this; }
Result& setScore(float score) { this->score = score; return *this; }
Result& setScoreStd(float score_std) { this->score_std = score_std; return *this; }
Result& setScoreTrain(float score) { this->score_train = score; return *this; }
Result& setScoreTest(float score) { this->score_test = score; return *this; }
Result& setScoreTrainStd(float score_std) { this->score_train_std = score_std; return *this; }
Result& setScoreTestStd(float score_std) { this->score_test_std = score_std; return *this; }
Result& setTrainTime(float train_time) { this->train_time = train_time; return *this; }
Result& setTrainTimeStd(float train_time_std) { this->train_time_std = train_time_std; return *this; }
Result& setTestTime(float test_time) { this->test_time = test_time; return *this; }
Result& setTestTimeStd(float test_time_std) { this->test_time_std = test_time_std; return *this; }
float get_score_train() { return score_train; }
float get_score_test() { return score_test; }
};
class Experiment {
private:
@@ -53,5 +57,6 @@ public:
Experiment& addResult(Result result) { results.push_back(result); return *this; }
Experiment& addRandomSeed(int random_seed) { random_seeds.push_back(random_seed); return *this; }
void save(string path) { cout << "Saving experiment..." << endl; }
void show() { cout << "Showing experiment..." << "Score Test: " << results[0].get_score_test() << " Score Train: " << results[0].get_score_train() << endl; }
};
#endif