Moral88 0.11.0__py3-none-any.whl → 0.13.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.
@@ -1,11 +0,0 @@
1
- Moral88/__init__.py,sha256=Z7iEZUqslxRyJU2to6iX6a5Ak1XBZxU3VT4RvOCjsEU,196
2
- Moral88/regression.py,sha256=WjNMpX0t99KGTrUKMBFg6LccnPvlnWKnjimu65BLrkc,12061
3
- Moral88/segmentation.py,sha256=N6Pg-220JfTxV01Bwjir8kOFMW3nfI0L_MM9zGrvDvg,6470
4
- Moral88/utils.py,sha256=4dZ165tRtwCEyz-wESp26-cZp-5Pz8HkSrmNPrKEH38,4534
5
- tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- tests/test_regression.py,sha256=j-XG9j5D24OaJBJT3ROnlvrMDrSR2sH4182U5L3PA5k,3124
7
- Moral88-0.11.0.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- Moral88-0.11.0.dist-info/METADATA,sha256=I9J_QFmYuvB-Q5YufPayenl5E4-WvCQznIMtoQlNC24,408
9
- Moral88-0.11.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
10
- Moral88-0.11.0.dist-info/top_level.txt,sha256=gg4pKIcQal4JhJAb77H5W6SHC77e-BeLTy4hxfXwmfw,14
11
- Moral88-0.11.0.dist-info/RECORD,,
tests/test_regression.py DELETED
@@ -1,100 +0,0 @@
1
- import pytest
2
- import numpy as np
3
- from Moral88.regression import (
4
- mean_absolute_error,
5
- mean_absolute_error,
6
- mean_squared_error,
7
- r2_score,
8
- mean_bias_deviation,
9
- adjusted_r2_score,
10
- root_mean_squared_error,
11
- mean_absolute_percentage_error,
12
- explained_variance_score
13
- )
14
- import warnings
15
- from Moral88.utils import DataValidator
16
-
17
- validator = DataValidator()
18
-
19
- def test_is_1d_array():
20
- validator = DataValidator()
21
- array = [[1], [2], [3]]
22
- with warnings.catch_warnings():
23
- warnings.simplefilter("ignore", UserWarning)
24
- result = validator.is_1d_array(array, warn=True)
25
- assert result.ndim == 1
26
- assert np.array_equal(result, np.array([1, 2, 3]))
27
-
28
- def test_check_samples():
29
- validator = DataValidator()
30
- array = [[1, 2], [3, 4], [5, 6]]
31
- result = validator.check_samples(array)
32
- assert result == 3
33
-
34
- def test_check_consistent_length():
35
- validator = DataValidator()
36
- array1 = [1, 2, 3]
37
- array2 = [4, 5, 6]
38
- validator.check_consistent_length(array1, array2) # Should not raise an error
39
-
40
- array3 = [7, 8]
41
- with pytest.raises(ValueError):
42
- validator.check_consistent_length(array1, array3)
43
-
44
- def test_mean_absolute_error():
45
-
46
- y_true = [3, -0.5, 2, 7]
47
- y_pred = [2.5, 0.0, 2, 8]
48
- result = mean_absolute_error(y_true, y_pred)
49
- assert result == pytest.approx(0.5, rel=1e-2)
50
-
51
- def test_mean_squared_error():
52
-
53
- y_true = [3, -0.5, 2, 7]
54
- y_pred = [2.5, 0.0, 2, 8]
55
- result = mean_squared_error(y_true, y_pred)
56
- assert result == pytest.approx(0.375, rel=1e-2)
57
-
58
- def test_r2_score():
59
-
60
- y_true = [3, -0.5, 2, 7]
61
- y_pred = [2.5, 0.0, 2, 8]
62
- result = r2_score(y_true, y_pred)
63
- assert result == pytest.approx(0.948, rel=1e-2)
64
-
65
- def test_mean_bias_deviation():
66
-
67
- y_true = [3, -0.5, 2, 7]
68
- y_pred = [2.5, 0.0, 2, 8]
69
- result = mean_bias_deviation(y_true, y_pred)
70
- assert result == pytest.approx(0.25, rel=1e-2)
71
-
72
- def test_explained_variance_score():
73
-
74
- y_true = [3, -0.5, 2, 7]
75
- y_pred = [2.5, 0.0, 2, 8]
76
- result = explained_variance_score(y_true, y_pred)
77
- assert result == pytest.approx(0.957, rel=1e-2)
78
-
79
- def test_mean_absolute_percentage_error():
80
-
81
- y_true = [3, -0.5, 2, 7]
82
- y_pred = [2.5, 0.0, 2, 8]
83
- result = mean_absolute_percentage_error(y_true, y_pred)
84
- assert result == pytest.approx(32.738095, rel=1e-2)
85
-
86
- def test_root_mean_squared_error():
87
-
88
- y_true = [3, -0.5, 2, 7]
89
- y_pred = [2.5, 0.0, 2, 8]
90
- result = root_mean_squared_error(y_true, y_pred)
91
- assert result == pytest.approx(0.612, rel=1e-2)
92
-
93
- def test_adjusted_r2_score():
94
-
95
- y_true = [3, -0.5, 2, 7]
96
- y_pred = [2.5, 0.0, 2, 8]
97
- n_features = 2
98
- result = adjusted_r2_score(y_true, y_pred, n_features)
99
- assert result == pytest.approx(0.8458, rel=1e-2)
100
-
File without changes