Moral88 0.6.0__py3-none-any.whl → 0.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- Moral88/__init__.py +0 -1
- Moral88/regression.py +3 -2
- {Moral88-0.6.0.dist-info → Moral88-0.7.0.dist-info}/METADATA +1 -1
- Moral88-0.7.0.dist-info/RECORD +8 -0
- Moral88-0.6.0.dist-info/RECORD +0 -8
- {Moral88-0.6.0.dist-info → Moral88-0.7.0.dist-info}/LICENSE +0 -0
- {Moral88-0.6.0.dist-info → Moral88-0.7.0.dist-info}/WHEEL +0 -0
- {Moral88-0.6.0.dist-info → Moral88-0.7.0.dist-info}/top_level.txt +0 -0
Moral88/__init__.py
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
from .regression import mean_absolute_error, mean_squared_error, r_squared
|
Moral88/regression.py
CHANGED
@@ -101,7 +101,7 @@ class DataValidator:
|
|
101
101
|
return y_true, y_pred
|
102
102
|
|
103
103
|
|
104
|
-
class
|
104
|
+
class metrics:
|
105
105
|
def mean_bias_deviation(self, y_true, y_pred, library=None, flatten=True):
|
106
106
|
"""
|
107
107
|
Computes Mean Bias Deviation (MBD).
|
@@ -292,6 +292,7 @@ class Metrics:
|
|
292
292
|
"""
|
293
293
|
y_true, y_pred = self.validator.validate_regression_targets(y_true, y_pred)
|
294
294
|
y_true, y_pred = self.validator.validate_mae_mse_inputs(y_true, y_pred, library)
|
295
|
+
y_true = np.clip(y_true, 1e-8, None)
|
295
296
|
|
296
297
|
if library == 'sklearn':
|
297
298
|
from sklearn.metrics import mean_absolute_percentage_error as sklearn_mape
|
@@ -309,7 +310,7 @@ class Metrics:
|
|
309
310
|
y_pred_tensor = tf.convert_to_tensor(y_pred, dtype=tf.float32)
|
310
311
|
return tf.reduce_mean(tf.abs((y_true_tensor - y_pred_tensor) / tf.clip_by_value(y_true_tensor, 1e-8, tf.float32.max))).numpy() * 100
|
311
312
|
|
312
|
-
return np.mean(np.abs((y_true - y_pred) / np.clip(y_true, 1e-8, None))) * 100
|
313
|
+
return np.mean(np.abs((y_true - y_pred) / np.clip(np.abs(y_true), 1e-8, None))) * 100
|
313
314
|
|
314
315
|
def explained_variance_score(self, y_true, y_pred, library=None, flatten=True):
|
315
316
|
"""
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Moral88/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
Moral88/regression.py,sha256=yzYuAdGv9IjLpXQ6yhlpC26ZIKcK5Cn3zDY_2N7lRW8,17263
|
3
|
+
Moral88/segmentation.py,sha256=v0yqxdrKbM9LM7wVKLjJ4HrhrSrilNNeWS6-oK_27Ag,1363
|
4
|
+
Moral88-0.7.0.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
+
Moral88-0.7.0.dist-info/METADATA,sha256=WxT0FQzxE2BEhykJCIKSdTkJlwCbb2_-89z3s3BHjZw,407
|
6
|
+
Moral88-0.7.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
7
|
+
Moral88-0.7.0.dist-info/top_level.txt,sha256=-dyn5iTprnSUHbtMpvRO-prJsIoaRxao7wlfCHLSsv4,8
|
8
|
+
Moral88-0.7.0.dist-info/RECORD,,
|
Moral88-0.6.0.dist-info/RECORD
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
Moral88/__init__.py,sha256=vb-aPc9ZbnYNSy9qq2fVESI63E10pYsCrDpnV8OHWkg,74
|
2
|
-
Moral88/regression.py,sha256=0aSRXLWur6tcC4xd806koyB2ktgPJodlOeXYCZZYDzE,17208
|
3
|
-
Moral88/segmentation.py,sha256=v0yqxdrKbM9LM7wVKLjJ4HrhrSrilNNeWS6-oK_27Ag,1363
|
4
|
-
Moral88-0.6.0.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
Moral88-0.6.0.dist-info/METADATA,sha256=6Y1H8Qh9wnrZVUr2gnoBYMnF5EsXY6ijMoS9bFZ21bE,407
|
6
|
-
Moral88-0.6.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
7
|
-
Moral88-0.6.0.dist-info/top_level.txt,sha256=-dyn5iTprnSUHbtMpvRO-prJsIoaRxao7wlfCHLSsv4,8
|
8
|
-
Moral88-0.6.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|