Moral88 0.6.0__tar.gz → 0.8.0__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- Moral88-0.8.0/Moral88/__init__.py +0 -0
- {Moral88-0.6.0 → Moral88-0.8.0}/Moral88/regression.py +5 -2
- {Moral88-0.6.0 → Moral88-0.8.0/Moral88.egg-info}/PKG-INFO +1 -1
- {Moral88-0.6.0/Moral88.egg-info → Moral88-0.8.0}/PKG-INFO +1 -1
- {Moral88-0.6.0 → Moral88-0.8.0}/setup.py +1 -1
- Moral88-0.6.0/Moral88/__init__.py +0 -1
- {Moral88-0.6.0 → Moral88-0.8.0}/LICENSE +0 -0
- {Moral88-0.6.0 → Moral88-0.8.0}/Moral88/segmentation.py +0 -0
- {Moral88-0.6.0 → Moral88-0.8.0}/Moral88.egg-info/SOURCES.txt +0 -0
- {Moral88-0.6.0 → Moral88-0.8.0}/Moral88.egg-info/dependency_links.txt +0 -0
- {Moral88-0.6.0 → Moral88-0.8.0}/Moral88.egg-info/requires.txt +0 -0
- {Moral88-0.6.0 → Moral88-0.8.0}/Moral88.egg-info/top_level.txt +0 -0
- {Moral88-0.6.0 → Moral88-0.8.0}/README.md +0 -0
- {Moral88-0.6.0 → Moral88-0.8.0}/setup.cfg +0 -0
File without changes
|
@@ -101,7 +101,9 @@ class DataValidator:
|
|
101
101
|
return y_true, y_pred
|
102
102
|
|
103
103
|
|
104
|
-
class
|
104
|
+
class metrics:
|
105
|
+
def __init__(self):
|
106
|
+
pass
|
105
107
|
def mean_bias_deviation(self, y_true, y_pred, library=None, flatten=True):
|
106
108
|
"""
|
107
109
|
Computes Mean Bias Deviation (MBD).
|
@@ -292,6 +294,7 @@ class Metrics:
|
|
292
294
|
"""
|
293
295
|
y_true, y_pred = self.validator.validate_regression_targets(y_true, y_pred)
|
294
296
|
y_true, y_pred = self.validator.validate_mae_mse_inputs(y_true, y_pred, library)
|
297
|
+
y_true = np.clip(y_true, 1e-8, None)
|
295
298
|
|
296
299
|
if library == 'sklearn':
|
297
300
|
from sklearn.metrics import mean_absolute_percentage_error as sklearn_mape
|
@@ -309,7 +312,7 @@ class Metrics:
|
|
309
312
|
y_pred_tensor = tf.convert_to_tensor(y_pred, dtype=tf.float32)
|
310
313
|
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
314
|
|
312
|
-
return np.mean(np.abs((y_true - y_pred) / np.clip(y_true, 1e-8, None))) * 100
|
315
|
+
return np.mean(np.abs((y_true - y_pred) / np.clip(np.abs(y_true), 1e-8, None))) * 100
|
313
316
|
|
314
317
|
def explained_variance_score(self, y_true, y_pred, library=None, flatten=True):
|
315
318
|
"""
|
@@ -1 +0,0 @@
|
|
1
|
-
from .regression import mean_absolute_error, mean_squared_error, r_squared
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|