Python implementation of Arithmetic, quasi arithmetic and other aggregating functions
Project description
Means, Aggregation functions…
Aggregations functions are: - Conjuctive - the final aggregated value will always be influenced by the smallest value among the inputs. - Disjnuctive - the aggregated value will always be influenced by the largest value among the inputs.
Example 1:
# example data
data = [0.2, 0.6, 0.7]
# configure function parameters
func1 = A_amn(p=0.5)
# use aggregation funciton
print(func1(data))
# Combine two aggregations - arithmetic mean and minimum
func2 = Combine2Aggregations(A_ar(), min)
# use combination of aggregation funciton
print(func2(data))
Example2:
To get information about aggregation function you can use __str__() or ‘repr()’ methods.
func1 = A_amn(p=0.5)
print(func1)
>>>A_amn(0.5)
func2 = Combine2Aggregations(A_ar(), A_md())
print(func2)
>>>A_armd
func3 = Combine2Aggregations(A_ar(), A_pw(r=3))
print(func3.__repr__()) # function parameters are printed in order: func1, func2
>>>A_arpw(r=3)
exponential(y, r=1) is given by equation
Aggregation functions
Aggregation function [1] is a mapping \(A:[0,1]^n\to[0,1]\), \(n \in \mathbb{N}\), \(n\ge 2\) which is is increasing and fulfills two boundary conditions, namely \(A(0,\dots,0) = 0\), \(A(1,\dots,1) = 1\).
The floowoing aggregation functions are implemented in this library:
Arithmetic mean
Quadratic mean
Product aggregation
Geometric mean
Harmonic mean
Power mean
special cases of power means \(A_{\text{pw}}^r\) [1] are: - Arithmetic Mean where r=1; - Quadratic Mean where r=2; - Harmonic Mean where r=-1; - Geometric Mean obtained as the limit \(\lim_{r \to 0} A_{\text{pw}}^r\).
Exponential mean
Lehmer mean
Arithmetic minimum mean
Arithmetic maximum mean
OWA
In the case of n = 2 (when only two values are aggregated) the calculation of the median and the Olympic aggregation are reduced to the case of calculating the arithmetic mean of the given values.
Median - ordered weighted aggregation
Olimpic aggregation
Olimpic aggregation
We can specify how many greatest and smallest records remove
:math:`A_{ln}` - Logaritmic aggregation
https://www.researchgate.net/publication/228886844_Logarithmic_mean_for_several_arguments
\(A^p_{A_1,A_2}\) - convex combinations of aggregation functions
We can construct covex combination of aggregation functions as \(A^p_{A_1,A_2}=pA_1+(1-p)A_2\), where \(A_1, A_2\) are aggregation functions and \(p \in [0,1]\).
References
Beliakov, G., Bustince, H., and Calvo, T.: A practical Guide to Averaging Functions. Berlin: Springer Vol. 329, 2016.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aggregationslib-0.1.4.tar.gz
.
File metadata
- Download URL: aggregationslib-0.1.4.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
ff798d19d6bc3ef949732ba1e5cd96846c91c5d7da0293b039cfb5d9fb24cab8
|
|
MD5 |
6e71855e5ea5e3674df1117be5e0b4b3
|
|
BLAKE2b-256 |
0a27f69686553037cf39d54585231109ce85cbd1bea7107279f9495db16fd219
|
File details
Details for the file aggregationslib-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: aggregationslib-0.1.4-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
a96e51969a25ebc110010e1e2d320d61432394c5fa1665b65941ef0bb338120e
|
|
MD5 |
6889a2031b6f7aea6df1e7c1a443817b
|
|
BLAKE2b-256 |
5d064f8912d34117b2775e41ca8c6d0301400e2a8e04aa502010166b0be781f7
|