Spaces:
Running
Running
Update Space (evaluate main: 8fd64d2f)
Browse files- mse.py +5 -3
- requirements.txt +1 -1
mse.py
CHANGED
|
@@ -14,7 +14,7 @@
|
|
| 14 |
"""MSE - Mean Squared Error Metric"""
|
| 15 |
|
| 16 |
import datasets
|
| 17 |
-
from sklearn.metrics import mean_squared_error
|
| 18 |
|
| 19 |
import evaluate
|
| 20 |
|
|
@@ -112,8 +112,10 @@ class Mse(evaluate.Metric):
|
|
| 112 |
|
| 113 |
def _compute(self, predictions, references, sample_weight=None, multioutput="uniform_average", squared=True):
|
| 114 |
|
| 115 |
-
mse =
|
| 116 |
-
references, predictions, sample_weight=sample_weight, multioutput=multioutput
|
|
|
|
|
|
|
| 117 |
)
|
| 118 |
|
| 119 |
return {"mse": mse}
|
|
|
|
| 14 |
"""MSE - Mean Squared Error Metric"""
|
| 15 |
|
| 16 |
import datasets
|
| 17 |
+
from sklearn.metrics import mean_squared_error, root_mean_squared_error
|
| 18 |
|
| 19 |
import evaluate
|
| 20 |
|
|
|
|
| 112 |
|
| 113 |
def _compute(self, predictions, references, sample_weight=None, multioutput="uniform_average", squared=True):
|
| 114 |
|
| 115 |
+
mse = (
|
| 116 |
+
mean_squared_error(references, predictions, sample_weight=sample_weight, multioutput=multioutput)
|
| 117 |
+
if squared
|
| 118 |
+
else root_mean_squared_error(references, predictions, sample_weight=sample_weight, multioutput=multioutput)
|
| 119 |
)
|
| 120 |
|
| 121 |
return {"mse": mse}
|
requirements.txt
CHANGED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
git+https://github.com/huggingface/evaluate@
|
| 2 |
scikit-learn
|
|
|
|
| 1 |
+
git+https://github.com/huggingface/evaluate@8fd64d2f5193b7e1da945abf04da26c1ff3d8a54
|
| 2 |
scikit-learn
|