Moral88 0.1.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- Moral88/__init__.py +0 -0
- Moral88/regression.py +25 -0
- Moral88-0.1.0.dist-info/LICENSE +0 -0
- Moral88-0.1.0.dist-info/METADATA +14 -0
- Moral88-0.1.0.dist-info/RECORD +7 -0
- Moral88-0.1.0.dist-info/WHEEL +5 -0
- Moral88-0.1.0.dist-info/top_level.txt +1 -0
Moral88/__init__.py
ADDED
File without changes
|
Moral88/regression.py
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Moral88/regression.py
|
2
|
+
import numpy as np
|
3
|
+
|
4
|
+
def mean_absolute_error(y_true, y_pred):
|
5
|
+
"""
|
6
|
+
Compute MAE (Mean Absolute Error)
|
7
|
+
"""
|
8
|
+
y_true, y_pred = np.array(y_true), np.array(y_pred)
|
9
|
+
return np.mean(np.abs(y_true - y_pred))
|
10
|
+
|
11
|
+
def mean_squared_error(y_true, y_pred):
|
12
|
+
"""
|
13
|
+
Compute MSE (Mean Squared Error)
|
14
|
+
"""
|
15
|
+
y_true, y_pred = np.array(y_true), np.array(y_pred)
|
16
|
+
return np.mean((y_true - y_pred) ** 2)
|
17
|
+
|
18
|
+
def r_squared(y_true, y_pred):
|
19
|
+
"""
|
20
|
+
Compute R-Squared
|
21
|
+
"""
|
22
|
+
y_true, y_pred = np.array(y_true), np.array(y_pred)
|
23
|
+
ss_total = np.sum((y_true - np.mean(y_true)) ** 2)
|
24
|
+
ss_residual = np.sum((y_true - y_pred) ** 2)
|
25
|
+
return 1 - (ss_residual / ss_total)
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: Moral88
|
3
|
+
Version: 0.1.0
|
4
|
+
Summary: A library for regression evaluation metrics.
|
5
|
+
Author: Morteza Alizadeh
|
6
|
+
Author-email: alizadeh.c2m@gmail.com
|
7
|
+
License: MIT
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
10
|
+
Classifier: Operating System :: OS Independent
|
11
|
+
Requires-Python: >=3.6
|
12
|
+
License-File: LICENSE
|
13
|
+
Requires-Dist: numpy
|
14
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Moral88/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
Moral88/regression.py,sha256=5Rtc3EduWt8FZmyu9mLCqwoA1s4Hb7ToGh5yev_1rO0,727
|
3
|
+
Moral88-0.1.0.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
+
Moral88-0.1.0.dist-info/METADATA,sha256=eERIH5OJsirY5Wa6DvSpLrWj9wTobBSRAnHMWs3BGro,407
|
5
|
+
Moral88-0.1.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
6
|
+
Moral88-0.1.0.dist-info/top_level.txt,sha256=-dyn5iTprnSUHbtMpvRO-prJsIoaRxao7wlfCHLSsv4,8
|
7
|
+
Moral88-0.1.0.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
Moral88
|