Spaces:
Sleeping
Sleeping
Zekun Wu
commited on
Commit
•
ba8c4f4
1
Parent(s):
16d8bbb
update
Browse files- util/evaluation.py +16 -16
util/evaluation.py
CHANGED
@@ -83,9 +83,9 @@ def statistical_tests(data):
|
|
83 |
]
|
84 |
|
85 |
pairwise_results = {
|
86 |
-
'Mann-Whitney U Test': {},
|
87 |
-
'Wilcoxon Test': {},
|
88 |
-
'Levene\'s Test': {},
|
89 |
'T-Test': {}
|
90 |
}
|
91 |
|
@@ -114,15 +114,15 @@ def statistical_tests(data):
|
|
114 |
pairwise_results['T-Test'][pair_name_score] = {"Statistic": t_stat, "p-value": t_p}
|
115 |
|
116 |
# ANOVA and post-hoc tests if applicable
|
117 |
-
score_columns = [v + score_suffix for v in variables]
|
118 |
-
score_data = [data[col] for col in score_columns]
|
119 |
-
anova_stat, anova_p = f_oneway(*score_data)
|
120 |
-
if anova_p < 0.05:
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
else:
|
125 |
-
|
126 |
|
127 |
results = {
|
128 |
#"Average Ranks": average_ranks.to_dict(),
|
@@ -130,10 +130,10 @@ def statistical_tests(data):
|
|
130 |
"Statistic": friedmanchisquare(*rank_data).statistic,
|
131 |
"p-value": friedmanchisquare(*rank_data).pvalue
|
132 |
},
|
133 |
-
"Kruskal-Wallis Test": {"Statistic": kw_stat, "p-value": kw_p},
|
134 |
-
**pairwise_results,
|
135 |
-
"ANOVA Test": {"Statistic": anova_stat, "p-value": anova_p},
|
136 |
-
"Tukey HSD Test": tukey_result_summary
|
137 |
}
|
138 |
|
139 |
return results
|
|
|
83 |
]
|
84 |
|
85 |
pairwise_results = {
|
86 |
+
# 'Mann-Whitney U Test': {},
|
87 |
+
# 'Wilcoxon Test': {},
|
88 |
+
# 'Levene\'s Test': {},
|
89 |
'T-Test': {}
|
90 |
}
|
91 |
|
|
|
114 |
pairwise_results['T-Test'][pair_name_score] = {"Statistic": t_stat, "p-value": t_p}
|
115 |
|
116 |
# ANOVA and post-hoc tests if applicable
|
117 |
+
# score_columns = [v + score_suffix for v in variables]
|
118 |
+
# score_data = [data[col] for col in score_columns]
|
119 |
+
# anova_stat, anova_p = f_oneway(*score_data)
|
120 |
+
# if anova_p < 0.05:
|
121 |
+
# mc = MultiComparison(data.melt()['value'], data.melt()['variable'])
|
122 |
+
# tukey_result = mc.tukeyhsd()
|
123 |
+
# tukey_result_summary = tukey_result.summary().as_html()
|
124 |
+
# else:
|
125 |
+
# tukey_result_summary = "ANOVA not significant, no post-hoc test performed."
|
126 |
|
127 |
results = {
|
128 |
#"Average Ranks": average_ranks.to_dict(),
|
|
|
130 |
"Statistic": friedmanchisquare(*rank_data).statistic,
|
131 |
"p-value": friedmanchisquare(*rank_data).pvalue
|
132 |
},
|
133 |
+
# "Kruskal-Wallis Test": {"Statistic": kw_stat, "p-value": kw_p},
|
134 |
+
# **pairwise_results,
|
135 |
+
# "ANOVA Test": {"Statistic": anova_stat, "p-value": anova_p},
|
136 |
+
#"Tukey HSD Test": tukey_result_summary
|
137 |
}
|
138 |
|
139 |
return results
|