Spaces:
Sleeping
Sleeping
add macro scores
Browse files- matching_series.py +8 -1
matching_series.py
CHANGED
@@ -13,6 +13,8 @@
|
|
13 |
# limitations under the License.
|
14 |
"""TODO: Add a description here."""
|
15 |
|
|
|
|
|
16 |
import datasets
|
17 |
import evaluate
|
18 |
import numpy as np
|
@@ -153,7 +155,9 @@ class matching_series(evaluate.Metric):
|
|
153 |
covered_mse_features.append(covered_mse_f)
|
154 |
harmonic_mean_features.append(harmonic_mean_f)
|
155 |
index_mse_features.append(index_mse_f)
|
156 |
-
|
|
|
|
|
157 |
return {
|
158 |
"matching_mse": matching_mse,
|
159 |
"harmonic_mean": harmonic_mean,
|
@@ -163,4 +167,7 @@ class matching_series(evaluate.Metric):
|
|
163 |
"harmonic_mean_features": harmonic_mean_features,
|
164 |
"covered_mse_features": covered_mse_features,
|
165 |
"index_mse_features": index_mse_features,
|
|
|
|
|
|
|
166 |
}
|
|
|
13 |
# limitations under the License.
|
14 |
"""TODO: Add a description here."""
|
15 |
|
16 |
+
import statistics
|
17 |
+
|
18 |
import datasets
|
19 |
import evaluate
|
20 |
import numpy as np
|
|
|
155 |
covered_mse_features.append(covered_mse_f)
|
156 |
harmonic_mean_features.append(harmonic_mean_f)
|
157 |
index_mse_features.append(index_mse_f)
|
158 |
+
macro_matching_mse = statistics.mean(matching_mse_features)
|
159 |
+
macro_covered_mse = statistics.mean(covered_mse_features)
|
160 |
+
macro_harmonic_mean = statistics.mean(harmonic_mean_features)
|
161 |
return {
|
162 |
"matching_mse": matching_mse,
|
163 |
"harmonic_mean": harmonic_mean,
|
|
|
167 |
"harmonic_mean_features": harmonic_mean_features,
|
168 |
"covered_mse_features": covered_mse_features,
|
169 |
"index_mse_features": index_mse_features,
|
170 |
+
"macro_matching_mse": macro_matching_mse,
|
171 |
+
"macro_covered_mse": macro_covered_mse,
|
172 |
+
"macro_harmonic_mean": macro_harmonic_mean,
|
173 |
}
|