aggregationslib 0.1.5.dev4__py3-none-any.whl → 0.1.5.dev6__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.
- aggregationslib/aggregations.py +8 -8
- {aggregationslib-0.1.5.dev4.dist-info → aggregationslib-0.1.5.dev6.dist-info}/METADATA +14 -18
- {aggregationslib-0.1.5.dev4.dist-info → aggregationslib-0.1.5.dev6.dist-info}/RECORD +6 -6
- {aggregationslib-0.1.5.dev4.dist-info → aggregationslib-0.1.5.dev6.dist-info}/WHEEL +0 -0
- {aggregationslib-0.1.5.dev4.dist-info → aggregationslib-0.1.5.dev6.dist-info}/licenses/LICENSE +0 -0
- {aggregationslib-0.1.5.dev4.dist-info → aggregationslib-0.1.5.dev6.dist-info}/top_level.txt +0 -0
aggregationslib/aggregations.py
CHANGED
|
@@ -468,28 +468,28 @@ class A_oln:
|
|
|
468
468
|
"""
|
|
469
469
|
|
|
470
470
|
name = 'oln'
|
|
471
|
-
valid_params = ['
|
|
471
|
+
valid_params = ['p']
|
|
472
472
|
|
|
473
|
-
def __init__(self,
|
|
474
|
-
self.
|
|
473
|
+
def __init__(self, p):
|
|
474
|
+
self.__p = p
|
|
475
475
|
|
|
476
476
|
def __call__(self, array):
|
|
477
477
|
if np.ndim(array) != 1:
|
|
478
478
|
raise ValueError("y must be 1 dimensional array")
|
|
479
|
-
if len(array) <= self.
|
|
479
|
+
if len(array) <= self.__p * 2:
|
|
480
480
|
return np.mean(array)
|
|
481
481
|
else:
|
|
482
|
-
d = np.sort(array)[self.
|
|
482
|
+
d = np.sort(array)[self.__p:-self.__p]
|
|
483
483
|
return np.mean(d)
|
|
484
484
|
|
|
485
485
|
def __repr__(self):
|
|
486
|
-
return f"A_oln(n={self.
|
|
486
|
+
return f"A_oln(n={self.__p})"
|
|
487
487
|
|
|
488
488
|
def __str__(self):
|
|
489
|
-
return f"A_oln({self.
|
|
489
|
+
return f"A_oln({self.__p})"
|
|
490
490
|
|
|
491
491
|
def toLatex(self, params: str):
|
|
492
|
-
return f"A_{{oln}}^{{
|
|
492
|
+
return f"A_{{oln}}^{{p={self.__p}}}({params})"
|
|
493
493
|
|
|
494
494
|
|
|
495
495
|
# TODO test this aggregation
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aggregationslib
|
|
3
|
-
Version: 0.1.5.
|
|
3
|
+
Version: 0.1.5.dev6
|
|
4
4
|
Summary: Python implementation of Arithmetic, quasi arithmetic and other aggregating functions
|
|
5
5
|
Author: wgalka
|
|
6
6
|
Project-URL: Homepage, https://github.com/wgalka/Means
|
|
@@ -63,15 +63,6 @@ or ‘**repr**\ ()’ methods.
|
|
|
63
63
|
print(func3.__repr__()) # function parameters are printed in order: func1, func2
|
|
64
64
|
>>>A_arpw(r=3)
|
|
65
65
|
|
|
66
|
-
``exponential(y, r=1)`` is given by equation
|
|
67
|
-
|
|
68
|
-
.. math::
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
A_6^{(r)}(x_1,...,x_n)= \frac{1}{r}\ln
|
|
72
|
-
\Big(\frac{1}{n} \sum \limits_{k=1}^{n} e^{rx_k}\Big), where
|
|
73
|
-
r \in \mathbb{R}, r \neq 0
|
|
74
|
-
|
|
75
66
|
Aggregation functions
|
|
76
67
|
---------------------
|
|
77
68
|
|
|
@@ -139,25 +130,30 @@ where r=-1; - Geometric Mean obtained as the limit
|
|
|
139
130
|
|
|
140
131
|
A_{ex}^{(r)}(x_1,...,x_n)= \frac{1}{r}\ln
|
|
141
132
|
\Big(\frac{1}{n} \sum \limits_{k=1}^{n} e^{rx_k}\Big), \text{where
|
|
142
|
-
} r \in \mathbb{R}
|
|
133
|
+
} r \in \mathbb{R}, r \neq 0
|
|
143
134
|
|
|
144
135
|
:math:`\mathbf{A_{lm}}` **- Lehmer mean**
|
|
145
136
|
|
|
146
|
-
.. math::
|
|
137
|
+
.. math::
|
|
138
|
+
|
|
139
|
+
A_{lm}(x_1,...,x_n)= \begin{cases}
|
|
140
|
+
0, & r\leq 1, \exists_{1 \leq k \leq n} x^{k} = 0 \\
|
|
141
|
+
\frac{\sum \limits_{k=1}^{n}x_k^r}{\sum \limits_{k=1}^{n}x_k^{r-1}}, & \text{otherwise}
|
|
142
|
+
\end{cases}
|
|
147
143
|
|
|
148
144
|
:math:`\mathbf{A_{amn}^{(p)}}` **- Arithmetic minimum mean**
|
|
149
145
|
|
|
150
146
|
.. math::
|
|
151
147
|
|
|
152
148
|
A_{amn}^{(p)}(x_1,...,x_n)=\frac{p}{n}\sum \limits_{k=1}^{n} x_k+
|
|
153
|
-
(1-p) \min \limits_{1 \leq k \leq n}x_k,
|
|
149
|
+
(1-p) \min \limits_{1 \leq k \leq n}x_k, p \in [0, 1]
|
|
154
150
|
|
|
155
151
|
:math:`\mathbf{A_{amx}^{(p)}}` **- Arithmetic maximum mean**
|
|
156
152
|
|
|
157
153
|
.. math::
|
|
158
154
|
|
|
159
155
|
A_{amx}^{(p)}(x_1,...,x_n)=\frac{p}{n}\sum \limits_{k=1}^{n} x_k+
|
|
160
|
-
(1-p) \max \limits_{1\leq k \leq n}x_k,
|
|
156
|
+
(1-p) \max \limits_{1\leq k \leq n}x_k, p \in [0, 1]
|
|
161
157
|
|
|
162
158
|
OWA
|
|
163
159
|
~~~
|
|
@@ -184,13 +180,11 @@ case of calculating the arithmetic mean of the given values.
|
|
|
184
180
|
|
|
185
181
|
We can specify how many greatest and smallest records remove
|
|
186
182
|
|
|
187
|
-
.. math:: A_{oln}^{(p)}(x_1,\dots,x_n) = \frac{1}{n-2p} \sum \limits_{k=p}^{n-p} y_k, \quad \text{where } \{y_1, \dots, y_n\} = \{x_1, \dots, x_n\},\ y_1 \leq y_2 \leq \dots \leq y_n
|
|
183
|
+
.. math:: A_{oln}^{(p)}(x_1,\dots,x_n) = \frac{1}{n-2p} \sum \limits_{k=p+1}^{n-p} y_k, \quad \text{where } \{y_1, \dots, y_n\} = \{x_1, \dots, x_n\},\ y_1 \leq y_2 \leq \dots \leq y_n, p \in \mathbb{N}, p\geq 1
|
|
188
184
|
|
|
189
185
|
--------------
|
|
190
186
|
|
|
191
|
-
:math:`\mathbf{A_{ln}}` **- Logaritmic aggregation**
|
|
192
|
-
|
|
193
|
-
https://www.researchgate.net/publication/228886844_Logarithmic_mean_for_several_arguments
|
|
187
|
+
:math:`\mathbf{A_{ln}}` **- Logaritmic aggregation [2]**
|
|
194
188
|
|
|
195
189
|
.. math::
|
|
196
190
|
|
|
@@ -209,3 +203,5 @@ References
|
|
|
209
203
|
|
|
210
204
|
1. Beliakov, G., Bustince, H., and Calvo, T.: A practical Guide to
|
|
211
205
|
Averaging Functions. Berlin: Springer Vol. 329, 2016.
|
|
206
|
+
2. `Mustonen, Seppo. (2010). Logarithmic mean for several
|
|
207
|
+
arguments. <https://www.researchgate.net/publication/228886844_Logarithmic_mean_for_several_arguments>`__
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
aggregationslib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
aggregationslib/aggregation.py,sha256=xByHAEHVtu3PdnK21dJz9bayKqEO9_8xPjDGQytMpSY,4565
|
|
3
|
-
aggregationslib/aggregations.py,sha256=
|
|
3
|
+
aggregationslib/aggregations.py,sha256=6EfXEnNvqIWNEvbTnhsMM37vHYnsRft6HnO1MZxXy2I,14644
|
|
4
4
|
aggregationslib/decimalaggregations.py,sha256=FYwro4KcojPH7ZMAEcKoE7MHN_1ojaTDY0UkEAzJN0M,5351
|
|
5
5
|
aggregationslib/example.py,sha256=4y3caiSBq4jkqz88Qan1m0LB389TXvlf7VSOPC_1Cj4,149
|
|
6
6
|
aggregationslib/purepython.py,sha256=Ov7AuBHLzoebS7HwTsDo8Ceed5pMzn3i71uevHnHbno,557
|
|
7
7
|
aggregationslib/conjuctive/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
aggregationslib/conjuctive/purepython.py,sha256=f7YOyrEvaTiBhWDyJrKPbWrym2PGFYIkTqfE2u1lOvk,82
|
|
9
9
|
aggregationslib/disjunctive/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
aggregationslib-0.1.5.
|
|
11
|
-
aggregationslib-0.1.5.
|
|
12
|
-
aggregationslib-0.1.5.
|
|
13
|
-
aggregationslib-0.1.5.
|
|
14
|
-
aggregationslib-0.1.5.
|
|
10
|
+
aggregationslib-0.1.5.dev6.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
+
aggregationslib-0.1.5.dev6.dist-info/METADATA,sha256=A58xQMbMOFPfhQ_i9-3QroHQQ57C7_CcHuGbKuLP3Zc,6053
|
|
12
|
+
aggregationslib-0.1.5.dev6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
13
|
+
aggregationslib-0.1.5.dev6.dist-info/top_level.txt,sha256=aAqYX4rNyBs40QOh2hc-jTE08IsMq0haGyyy7-GSdUQ,16
|
|
14
|
+
aggregationslib-0.1.5.dev6.dist-info/RECORD,,
|
|
File without changes
|
{aggregationslib-0.1.5.dev4.dist-info → aggregationslib-0.1.5.dev6.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|