Moral88 0.6.0__tar.gz → 0.7.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
File without changes
@@ -101,7 +101,7 @@ class DataValidator:
101
101
  return y_true, y_pred
102
102
 
103
103
 
104
- class Metrics:
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
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Moral88
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Summary: A library for regression evaluation metrics.
5
5
  Author: Morteza Alizadeh
6
6
  Author-email: alizadeh.c2m@gmail.com
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Moral88
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Summary: A library for regression evaluation metrics.
5
5
  Author: Morteza Alizadeh
6
6
  Author-email: alizadeh.c2m@gmail.com
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='Moral88',
5
- version='0.6.0',
5
+ version='0.7.0',
6
6
  description='A library for regression evaluation metrics.',
7
7
  author='Morteza Alizadeh',
8
8
  author_email='alizadeh.c2m@gmail.com',
@@ -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