Complete Excel output for bestResults with Friedman test

This commit is contained in:
2023-09-28 18:52:37 +02:00
parent cfcf3c16df
commit 9d3d9cc6c6
6 changed files with 139 additions and 33 deletions

View File

@@ -13,11 +13,30 @@ namespace platform {
int tie;
int loss;
};
struct FriedmanResult {
double statistic;
double criticalValue;
long double pvalue;
bool reject;
};
struct HolmLine {
string model;
long double pvalue;
double rank;
WTL wtl;
bool reject;
};
struct HolmResult {
string model;
vector<HolmLine> holmLines;
};
class Statistics {
public:
Statistics(vector<string>& models, vector<string>& datasets, json data, double significance = 0.05);
Statistics(vector<string>& models, vector<string>& datasets, json data, double significance = 0.05, bool output = true);
bool friedmanTest();
void postHocHolmTest(bool friedmanResult);
FriedmanResult& getFriedmanResult();
HolmResult& getHolmResult();
private:
void fit();
void computeRanks();
@@ -26,6 +45,7 @@ namespace platform {
vector<string> datasets;
json data;
double significance;
bool output;
bool fitted = false;
int nModels = 0;
int nDatasets = 0;
@@ -34,6 +54,8 @@ namespace platform {
map<string, float> ranks;
int maxModelName = 0;
int maxDatasetName = 0;
FriedmanResult friedmanResult;
HolmResult holmResult;
};
}
#endif // !STATISTICS_H