Duplicate statistics tests in class

This commit is contained in:
2023-09-28 00:45:15 +02:00
parent 00c6cf663b
commit ac89a451e3
4 changed files with 258 additions and 3 deletions

37
src/Platform/Statistics.h Normal file
View File

@@ -0,0 +1,37 @@
#ifndef STATISTICS_H
#define STATISTICS_H
#include <iostream>
#include <vector>
#include <nlohmann/json.hpp>
using namespace std;
using json = nlohmann::json;
namespace platform {
struct WTL {
int win;
int tie;
int loss;
};
class Statistics {
public:
Statistics(vector<string>& models, vector<string>& datasets, json data, double significance = 0.05);
bool friedmanTest();
void postHocHolmTest();
private:
void fit();
void computeRanks();
void computeWTL();
vector<string> models;
vector<string> datasets;
json data;
double significance;
bool fitted = false;
int nModels = 0;
int nDatasets = 0;
int controlIdx = 0;
map<int, WTL> wtl;
map<string, float> ranks;
};
}
#endif // !STATISTICS_H