Moral88 0.1.0__tar.gz
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-0.1.0/LICENSE +0 -0
- Moral88-0.1.0/Moral88/__init__.py +0 -0
- Moral88-0.1.0/Moral88/regression.py +25 -0
- Moral88-0.1.0/Moral88.egg-info/PKG-INFO +12 -0
- Moral88-0.1.0/Moral88.egg-info/SOURCES.txt +10 -0
- Moral88-0.1.0/Moral88.egg-info/dependency_links.txt +1 -0
- Moral88-0.1.0/Moral88.egg-info/requires.txt +1 -0
- Moral88-0.1.0/Moral88.egg-info/top_level.txt +1 -0
- Moral88-0.1.0/PKG-INFO +12 -0
- Moral88-0.1.0/README.md +18 -0
- Moral88-0.1.0/setup.cfg +4 -0
- Moral88-0.1.0/setup.py +19 -0
Moral88-0.1.0/LICENSE
ADDED
File without changes
|
File without changes
|
@@ -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)
|
@@ -0,0 +1,12 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
numpy
|
@@ -0,0 +1 @@
|
|
1
|
+
Moral88
|
Moral88-0.1.0/PKG-INFO
ADDED
@@ -0,0 +1,12 @@
|
|
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
|
Moral88-0.1.0/README.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# Moral88
|
2
|
+
A Python library for regression evaluation metrics.
|
3
|
+
|
4
|
+
## Installation
|
5
|
+
To use the library, simply clone the repository and add it to your project.
|
6
|
+
|
7
|
+
## Usage
|
8
|
+
```python
|
9
|
+
from Moral88.regression import mean_absolute_error, mean_squared_error, r_squared
|
10
|
+
|
11
|
+
y_true = [1, 2, 3]
|
12
|
+
y_pred = [1, 2, 4]
|
13
|
+
|
14
|
+
mae = mean_absolute_error(y_true, y_pred)
|
15
|
+
mse = mean_squared_error(y_true, y_pred)
|
16
|
+
r2 = r_squared(y_true, y_pred)
|
17
|
+
|
18
|
+
print(f"MAE: {mae}, MSE: {mse}, R²: {r2}")
|
Moral88-0.1.0/setup.cfg
ADDED
Moral88-0.1.0/setup.py
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
from setuptools import setup, find_packages
|
2
|
+
|
3
|
+
setup(
|
4
|
+
name='Moral88',
|
5
|
+
version='0.1.0',
|
6
|
+
description='A library for regression evaluation metrics.',
|
7
|
+
author='Morteza Alizadeh',
|
8
|
+
author_email='alizadeh.c2m@gmail.com',
|
9
|
+
# url='https://github.com/yourusername/morteza',
|
10
|
+
packages=find_packages(),
|
11
|
+
install_requires=['numpy'],
|
12
|
+
license='MIT',
|
13
|
+
classifiers=[
|
14
|
+
'Programming Language :: Python :: 3',
|
15
|
+
'License :: OSI Approved :: MIT License',
|
16
|
+
'Operating System :: OS Independent',
|
17
|
+
],
|
18
|
+
python_requires='>=3.6',
|
19
|
+
)
|