aggregationslib 0.2.7__tar.gz → 0.2.9__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.
- aggregationslib-0.2.9/AGENTS.md +7 -0
- {aggregationslib-0.2.7/aggregationslib.egg-info → aggregationslib-0.2.9}/PKG-INFO +78 -16
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/README.md +3 -3
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/README.pl.md +13 -5
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/README.rst +80 -18
- {aggregationslib-0.2.7 → aggregationslib-0.2.9/aggregationslib.egg-info}/PKG-INFO +78 -16
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib.egg-info/SOURCES.txt +4 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib.egg-info/scm_file_list.json +4 -0
- aggregationslib-0.2.9/aggregationslib.egg-info/scm_version.json +8 -0
- aggregationslib-0.2.9/apps/shiny/README.md +71 -0
- aggregationslib-0.2.9/apps/shiny/README.pl.md +71 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/apps/shiny/app.py +215 -19
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/apps/shiny/core.py +107 -6
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/build_docs.ps1 +2 -2
- aggregationslib-0.2.9/docs/CNAME +1 -0
- aggregationslib-0.2.9/docs/assets/means-icon.svg +20 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/site.css +188 -185
- aggregationslib-0.2.9/docs/en/index.html +548 -0
- aggregationslib-0.2.9/docs/pl/index.html +723 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/tests/test_shiny_app.py +51 -1
- aggregationslib-0.2.7/aggregationslib.egg-info/scm_version.json +0 -8
- aggregationslib-0.2.7/apps/shiny/README.md +0 -118
- aggregationslib-0.2.7/docs/en/index.html +0 -80
- aggregationslib-0.2.7/docs/pl/index.html +0 -80
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/.gitignore +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/LICENSE +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregation_classification.html +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib/__init__.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib/aggregation.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib/aggregations.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib/cli.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib/conjuctive/__init__.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib/conjuctive/purepython.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib/decimalaggregations.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib/disjunctive/__init__.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib/example.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib/feature_selection/__init__.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib/feature_selection/binary_fuzzy_entropy.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib/feature_selection/fuzzy_com_entropy.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib/models/__init__.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib/models/ensemble/__init__.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib/models/ensemble/aggregation_regressor.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib/models/single/__init__.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib/ndarray.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib/purepython.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib.egg-info/dependency_links.txt +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib.egg-info/entry_points.txt +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib.egg-info/requires.txt +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/aggregationslib.egg-info/top_level.txt +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/apps/shiny/column-selection.js +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/apps/shiny/evaluation.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/apps/shiny/example.csv +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/assets/icons/icon.ico +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/assets/icons/icon.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/assets/icons/icon.svg +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/commands.md +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/diagram-aggregation-classification.svg +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/diagram-implikacja-agregacja.svg +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/diagram-klasyfikacja-agregacji.svg +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/diagram-odwzorowanie.svg +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/.nojekyll +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/aggregation-classes.md +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/aggregation-plots.md +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/aggregation_classification.html +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregation-surfaces-all.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregation-surfaces.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregations/A_amn_p=0.5.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregations/A_amx_p=0.5.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregations/A_ar.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregations/A_ex2_p=2,q=2.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregations/A_ex3_p=2,q=1.5.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregations/A_ex_r=1.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregations/A_gm.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregations/A_hm.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregations/A_lm_r=2.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregations/A_lo.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregations/A_md.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregations/A_mn.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregations/A_mx.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregations/A_ol.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregations/A_oln_p=1.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregations/A_pr.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregations/A_pw_r=2.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/aggregations/A_qd.png +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/diagram-aggregation-classification.svg +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/assets/diagram-klasyfikacja-agregacji.svg +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/fuzzy-integrals.md +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/index.html +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/docs/klasyfikacja_agregacji.html +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/generate_aggregation_plots.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/klasyfikacja_agregacji.html +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/pyproject.toml +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/setup.cfg +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/tests/__init__.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/tests/data/README.md +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/tests/data/wolfram_integral_reference.json +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/tests/data/wolfram_measure_reference.json +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/tests/test_aggregations.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/tests/test_decimal_exponential_mean.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/tests/test_decimal_fuzzy_integrals.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/tests/test_exponential_cardinality.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/tests/test_fuzzy_integrals.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/tests/test_ndarray.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/tests/test_shiny_evaluation.py +0 -0
- {aggregationslib-0.2.7 → aggregationslib-0.2.9}/tests/test_wolfram_measures.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aggregationslib
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.9
|
|
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
|
|
@@ -32,26 +32,31 @@ Means, Aggregation functions...
|
|
|
32
32
|
|
|
33
33
|
Documentation:
|
|
34
34
|
|
|
35
|
-
- English
|
|
36
|
-
- Polski
|
|
35
|
+
- `English <https://wgalka.github.io/Means/en/>`__
|
|
36
|
+
- `Polski <https://wgalka.github.io/Means/pl/>`__
|
|
37
37
|
|
|
38
|
-
Aggregation functions can be classified in several ways. A familiar
|
|
39
|
-
is between three types of behaviour:
|
|
38
|
+
Aggregation functions can be classified in several ways. A familiar
|
|
39
|
+
distinction is between three types of behaviour:
|
|
40
40
|
|
|
41
41
|
- Conjunctive — an AND-like combination of the inputs.
|
|
42
42
|
- Averaging — a result between the smallest and largest input values.
|
|
43
43
|
- Disjunctive — an OR-like combination of the inputs.
|
|
44
44
|
|
|
45
|
-
These are not the only possibilities: aggregation functions can also
|
|
46
|
-
mixed behaviour. The diagram below presents a broader
|
|
45
|
+
These are not the only possibilities: aggregation functions can also
|
|
46
|
+
exhibit mixed behaviour. The diagram below presents a broader
|
|
47
|
+
classification.
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
:alt: Classification of aggregation functions
|
|
50
|
-
:target: https://wgalka.github.io/Means/aggregation_classification.html
|
|
49
|
+
|Classification of aggregation functions|
|
|
51
50
|
|
|
52
|
-
*Diagram elaborated on the basis of: A. Pradera, G. Beliakov, H.
|
|
51
|
+
*Diagram elaborated on the basis of: A. Pradera, G. Beliakov, H.
|
|
52
|
+
Bustince, B. De Baets, "A review of the relationships between
|
|
53
|
+
implication, negation and aggregation functions from the point of view
|
|
54
|
+
of material implication", Information Sciences 329 (2016) 357–380,*
|
|
55
|
+
`DOI:
|
|
56
|
+
10.1016/j.ins.2015.09.033 <https://doi.org/10.1016/j.ins.2015.09.033>`__\ *.*
|
|
53
57
|
|
|
54
|
-
An interactive version of this diagram is available at:
|
|
58
|
+
An interactive version of this diagram is available at:
|
|
59
|
+
https://wgalka.github.io/Means/aggregation_classification.html
|
|
55
60
|
|
|
56
61
|
Example 1:
|
|
57
62
|
^^^^^^^^^^
|
|
@@ -90,6 +95,49 @@ or '**repr**\ ()' methods.
|
|
|
90
95
|
print(func3.__repr__()) # function parameters are printed in order: func1, func2
|
|
91
96
|
>>>A_arpw(r=3)
|
|
92
97
|
|
|
98
|
+
Multidimensional arrays
|
|
99
|
+
-----------------------
|
|
100
|
+
|
|
101
|
+
``aggregationslib.ndarray`` provides the same ``A_...`` objects as
|
|
102
|
+
``aggregationslib.aggregations``, with additional constructor options
|
|
103
|
+
``axis`` and ``keepdims``. It applies the existing vector implementation
|
|
104
|
+
separately to each vector along the selected axis.
|
|
105
|
+
|
|
106
|
+
.. code:: python
|
|
107
|
+
|
|
108
|
+
import numpy as np
|
|
109
|
+
from aggregationslib.ndarray import A_ar, A_ch
|
|
110
|
+
from aggregationslib import weighted_measure
|
|
111
|
+
|
|
112
|
+
X = np.array([[0.2, 0.6, 0.9], [0.9, 0.2, 0.6]])
|
|
113
|
+
A_ar(axis=1)(X) # shape (2,): one value per row
|
|
114
|
+
A_ar(axis=0)(X) # shape (3,): one value per column
|
|
115
|
+
A_ar(axis=1, keepdims=True)(X) # shape (2, 1)
|
|
116
|
+
A_ar()(X) # scalar: aggregate all elements
|
|
117
|
+
|
|
118
|
+
mu = weighted_measure([0.5, 0.3, 0.2])
|
|
119
|
+
A_ch(measure=mu, axis=-1)(X) # array([0.46, 0.63])
|
|
120
|
+
|
|
121
|
+
``axis=None`` (the default) flattens the input in C order. An integer
|
|
122
|
+
axis, including a negative index, reduces that axis; tuples of axes are
|
|
123
|
+
not supported. For an input of shape ``(m, n)``, ``axis=1`` returns
|
|
124
|
+
shape ``(m,)``, including ``(1,)`` when there is just one row.
|
|
125
|
+
``keepdims=True`` retains reduced dimensions with length one. A complete
|
|
126
|
+
reduction returns a scalar unless ``keepdims=True``.
|
|
127
|
+
|
|
128
|
+
Choquet and Sugeno use the same measure for each vector. Its size must
|
|
129
|
+
match the selected axis length, or the total element count for
|
|
130
|
+
``axis=None``. Choquet's ``quasi_overlap`` continues to accept scalar
|
|
131
|
+
callbacks. ``Combine2Aggregations`` accepts vector callables or objects
|
|
132
|
+
from this module; the combination's own ``axis`` and ``keepdims``
|
|
133
|
+
control the reduction.
|
|
134
|
+
|
|
135
|
+
Empty vectors are rejected. An empty batch of nonempty vectors returns
|
|
136
|
+
an empty floating-point array of the appropriate shape. The mathematical
|
|
137
|
+
domains, parameter rules and numerical behavior are inherited from the
|
|
138
|
+
vector implementations. This module uses iteration over vectors, not
|
|
139
|
+
vectorized implementations of the aggregation formulas.
|
|
140
|
+
|
|
93
141
|
Aggregation functions
|
|
94
142
|
---------------------
|
|
95
143
|
|
|
@@ -150,10 +198,11 @@ Each constructor returns a monotone fuzzy measure with
|
|
|
150
198
|
:math:`\mu(A)=\sum_{j=1}^{|A|}w_j`. The normalized weights are applied
|
|
151
199
|
by descending value rank, so the first belongs to the largest value;
|
|
152
200
|
with the Choquet integral this capacity gives the OWA aggregation.
|
|
153
|
-
- **Exponential cardinality**
|
|
201
|
+
- **Exponential cardinality**
|
|
202
|
+
(``exponential_cardinality_measure(n, q=1)``):
|
|
154
203
|
:math:`\mu(A)=(|A|/n)^q`, where ``q`` must be finite and :math:`q>0`.
|
|
155
|
-
For :math:`q=1`, this is the uniform/cardinality measure, and the
|
|
156
|
-
Choquet integral equals the arithmetic mean.
|
|
204
|
+
For :math:`q=1`, this is the uniform/cardinality measure, and the
|
|
205
|
+
discrete Choquet integral equals the arithmetic mean.
|
|
157
206
|
|
|
158
207
|
The constructors are in ``aggregationslib.aggregation``; Decimal
|
|
159
208
|
equivalents are available in ``aggregationslib.decimalaggregations``.
|
|
@@ -206,7 +255,8 @@ available in ``aggregationslib.aggregation`` and
|
|
|
206
255
|
by descending value rank, so the first belongs to the largest value.
|
|
207
256
|
In the Sugeno integral this capacity is used in the max–min formula;
|
|
208
257
|
the result is not the OWA aggregation.
|
|
209
|
-
- **Exponential cardinality**
|
|
258
|
+
- **Exponential cardinality**
|
|
259
|
+
(``exponential_cardinality_measure(n, q=1)``):
|
|
210
260
|
:math:`\mu(A)=(|A|/n)^q`, where ``q`` must be finite and :math:`q>0`.
|
|
211
261
|
For :math:`q=1`, this is the uniform/cardinality measure.
|
|
212
262
|
|
|
@@ -401,3 +451,15 @@ References
|
|
|
401
451
|
Averaging Functions*. Berlin: Springer, vol. 329, 2016.
|
|
402
452
|
2. `Mustonen, Seppo. (2010). Logarithmic mean for several
|
|
403
453
|
arguments. <https://www.researchgate.net/publication/228886844_Logarithmic_mean_for_several_arguments>`__
|
|
454
|
+
|
|
455
|
+
Shiny app
|
|
456
|
+
=========
|
|
457
|
+
|
|
458
|
+
A local interface lets you upload a CSV table, select columns and an
|
|
459
|
+
aggregation, add input vectors, and download row-wise results. It also
|
|
460
|
+
generates the equivalent Python code using ``aggregationslib.ndarray``.
|
|
461
|
+
See `setup and
|
|
462
|
+
usage <https://github.com/wgalka/Means/blob/main/apps/shiny/README.md>`__.
|
|
463
|
+
|
|
464
|
+
.. |Classification of aggregation functions| image:: https://raw.githubusercontent.com/wgalka/Means/main/docs/assets/diagram-aggregation-classification.svg
|
|
465
|
+
:target: https://wgalka.github.io/Means/aggregation_classification.html
|
|
@@ -3,8 +3,8 @@ Means, Aggregation functions...
|
|
|
3
3
|
|
|
4
4
|
Documentation:
|
|
5
5
|
|
|
6
|
-
- English
|
|
7
|
-
- Polski
|
|
6
|
+
- [English](https://wgalka.github.io/Means/en/)
|
|
7
|
+
- [Polski](https://wgalka.github.io/Means/pl/)
|
|
8
8
|
|
|
9
9
|
Aggregation functions can be classified in several ways. A familiar distinction
|
|
10
10
|
is between three types of behaviour:
|
|
@@ -360,4 +360,4 @@ We can construct covex combination of aggregation functions as $A^{(p)}_{A_1,A_2
|
|
|
360
360
|
A local interface lets you upload a CSV table, select columns and an
|
|
361
361
|
aggregation, add input vectors, and download row-wise results. It also
|
|
362
362
|
generates the equivalent Python code using `aggregationslib.ndarray`.
|
|
363
|
-
See [setup and usage](apps/shiny/README.md).
|
|
363
|
+
See [setup and usage](https://github.com/wgalka/Means/blob/main/apps/shiny/README.md).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Means
|
|
2
2
|
|
|
3
|
-
Means to biblioteka
|
|
3
|
+
Means to biblioteka, która udostępnia funkcje agregacji dla Python.
|
|
4
4
|
|
|
5
5
|
Dokumentacja:
|
|
6
6
|
|
|
@@ -76,7 +76,7 @@ Przy domyślnej mierze `mu(A) = |A| / n` całka Choqueta jest równa średniej
|
|
|
76
76
|
arytmetycznej: $C_\mu(x_1,\dots,x_n)=(1/n)\sum_{i=1}^n x_i$. Wersje `float` mogą różnić
|
|
77
77
|
się od średniej na ostatnich bitach wskutek zaokrągleń.
|
|
78
78
|
|
|
79
|
-
Szczegóły i przykłady: [całki rozmyte](docs/fuzzy-integrals.md).
|
|
79
|
+
Szczegóły i przykłady: [całki rozmyte](https://github.com/wgalka/Means/blob/main/docs/fuzzy-integrals.md).
|
|
80
80
|
|
|
81
81
|
## Zbiory klasyczne i rozmyte
|
|
82
82
|
|
|
@@ -409,7 +409,7 @@ z biblioteki. Zakres jest dobierany osobno dla każdej funkcji, dlatego część
|
|
|
409
409
|
wykresów pokazuje wartości spoza `[0,1]`, a funkcje wymagające dodatnich
|
|
410
410
|
argumentów są rysowane na dziedzinie dodatniej:
|
|
411
411
|
|
|
412
|
-

|
|
412
|
+

|
|
413
413
|
|
|
414
414
|
Wykres można odtworzyć poleceniem:
|
|
415
415
|
|
|
@@ -418,7 +418,7 @@ python .\generate_aggregation_plots.py
|
|
|
418
418
|
```
|
|
419
419
|
|
|
420
420
|
Każdy wykres jest również dostępny osobno w
|
|
421
|
-
[`docs/aggregation-plots.md`](docs/aggregation-plots.md), pod nazwą swojej
|
|
421
|
+
[`docs/aggregation-plots.md`](https://github.com/wgalka/Means/blob/main/docs/aggregation-plots.md), pod nazwą swojej
|
|
422
422
|
funkcji, np. `A_amx`.
|
|
423
423
|
|
|
424
424
|
OWA jest zwykle symetryczny, monotoniczny i idempotentny. W niektórych
|
|
@@ -537,7 +537,7 @@ Dla argumentów `2, 5, 8` funkcja averaging musi spełniać:
|
|
|
537
537
|
Średnia arytmetyczna daje w tym przykładzie `5`.
|
|
538
538
|
|
|
539
539
|
Wizualny schemat klas agregacji znajduje się w pliku
|
|
540
|
-
[`docs/aggregation-classes.md`](docs/aggregation-classes.md).
|
|
540
|
+
[`docs/aggregation-classes.md`](https://github.com/wgalka/Means/blob/main/docs/aggregation-classes.md).
|
|
541
541
|
|
|
542
542
|
## Funkcja dualna i samodualność
|
|
543
543
|
|
|
@@ -739,3 +739,11 @@ A_arpw(r=3)
|
|
|
739
739
|
2. Mustonen, Seppo (2010):
|
|
740
740
|
[Logarithmic mean for several arguments](https://www.researchgate.net/publication/228886844_Logarithmic_mean_for_several_arguments).
|
|
741
741
|
3. [Aggregation functions](https://arxiv.org/pdf/2208.01644).
|
|
742
|
+
|
|
743
|
+
# Aplikacja Shiny
|
|
744
|
+
|
|
745
|
+
Lokalny interfejs pozwala wgrać tabelę CSV, wybrać kolumny oraz funkcję
|
|
746
|
+
agregacji, dopisać dodatkowe wektory i pobrać wyniki dla poszczególnych
|
|
747
|
+
wierszy. Generuje także równoważny kod w Pythonie z użyciem
|
|
748
|
+
`aggregationslib.ndarray`.
|
|
749
|
+
Zobacz [instalację i instrukcję użycia](https://github.com/wgalka/Means/blob/main/apps/shiny/README.pl.md).
|
|
@@ -5,26 +5,31 @@ Means, Aggregation functions...
|
|
|
5
5
|
|
|
6
6
|
Documentation:
|
|
7
7
|
|
|
8
|
-
- English
|
|
9
|
-
- Polski
|
|
8
|
+
- `English <https://wgalka.github.io/Means/en/>`__
|
|
9
|
+
- `Polski <https://wgalka.github.io/Means/pl/>`__
|
|
10
10
|
|
|
11
|
-
Aggregation functions can be classified in several ways. A familiar
|
|
12
|
-
is between three types of behaviour:
|
|
11
|
+
Aggregation functions can be classified in several ways. A familiar
|
|
12
|
+
distinction is between three types of behaviour:
|
|
13
13
|
|
|
14
14
|
- Conjunctive — an AND-like combination of the inputs.
|
|
15
15
|
- Averaging — a result between the smallest and largest input values.
|
|
16
16
|
- Disjunctive — an OR-like combination of the inputs.
|
|
17
17
|
|
|
18
|
-
These are not the only possibilities: aggregation functions can also
|
|
19
|
-
mixed behaviour. The diagram below presents a broader
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
These are not the only possibilities: aggregation functions can also
|
|
19
|
+
exhibit mixed behaviour. The diagram below presents a broader
|
|
20
|
+
classification.
|
|
21
|
+
|
|
22
|
+
|Classification of aggregation functions|
|
|
23
|
+
|
|
24
|
+
*Diagram elaborated on the basis of: A. Pradera, G. Beliakov, H.
|
|
25
|
+
Bustince, B. De Baets, "A review of the relationships between
|
|
26
|
+
implication, negation and aggregation functions from the point of view
|
|
27
|
+
of material implication", Information Sciences 329 (2016) 357–380,*
|
|
28
|
+
`DOI:
|
|
29
|
+
10.1016/j.ins.2015.09.033 <https://doi.org/10.1016/j.ins.2015.09.033>`__\ *.*
|
|
30
|
+
|
|
31
|
+
An interactive version of this diagram is available at:
|
|
32
|
+
https://wgalka.github.io/Means/aggregation_classification.html
|
|
28
33
|
|
|
29
34
|
Example 1:
|
|
30
35
|
^^^^^^^^^^
|
|
@@ -63,6 +68,49 @@ or '**repr**\ ()' methods.
|
|
|
63
68
|
print(func3.__repr__()) # function parameters are printed in order: func1, func2
|
|
64
69
|
>>>A_arpw(r=3)
|
|
65
70
|
|
|
71
|
+
Multidimensional arrays
|
|
72
|
+
-----------------------
|
|
73
|
+
|
|
74
|
+
``aggregationslib.ndarray`` provides the same ``A_...`` objects as
|
|
75
|
+
``aggregationslib.aggregations``, with additional constructor options
|
|
76
|
+
``axis`` and ``keepdims``. It applies the existing vector implementation
|
|
77
|
+
separately to each vector along the selected axis.
|
|
78
|
+
|
|
79
|
+
.. code:: python
|
|
80
|
+
|
|
81
|
+
import numpy as np
|
|
82
|
+
from aggregationslib.ndarray import A_ar, A_ch
|
|
83
|
+
from aggregationslib import weighted_measure
|
|
84
|
+
|
|
85
|
+
X = np.array([[0.2, 0.6, 0.9], [0.9, 0.2, 0.6]])
|
|
86
|
+
A_ar(axis=1)(X) # shape (2,): one value per row
|
|
87
|
+
A_ar(axis=0)(X) # shape (3,): one value per column
|
|
88
|
+
A_ar(axis=1, keepdims=True)(X) # shape (2, 1)
|
|
89
|
+
A_ar()(X) # scalar: aggregate all elements
|
|
90
|
+
|
|
91
|
+
mu = weighted_measure([0.5, 0.3, 0.2])
|
|
92
|
+
A_ch(measure=mu, axis=-1)(X) # array([0.46, 0.63])
|
|
93
|
+
|
|
94
|
+
``axis=None`` (the default) flattens the input in C order. An integer
|
|
95
|
+
axis, including a negative index, reduces that axis; tuples of axes are
|
|
96
|
+
not supported. For an input of shape ``(m, n)``, ``axis=1`` returns
|
|
97
|
+
shape ``(m,)``, including ``(1,)`` when there is just one row.
|
|
98
|
+
``keepdims=True`` retains reduced dimensions with length one. A complete
|
|
99
|
+
reduction returns a scalar unless ``keepdims=True``.
|
|
100
|
+
|
|
101
|
+
Choquet and Sugeno use the same measure for each vector. Its size must
|
|
102
|
+
match the selected axis length, or the total element count for
|
|
103
|
+
``axis=None``. Choquet's ``quasi_overlap`` continues to accept scalar
|
|
104
|
+
callbacks. ``Combine2Aggregations`` accepts vector callables or objects
|
|
105
|
+
from this module; the combination's own ``axis`` and ``keepdims``
|
|
106
|
+
control the reduction.
|
|
107
|
+
|
|
108
|
+
Empty vectors are rejected. An empty batch of nonempty vectors returns
|
|
109
|
+
an empty floating-point array of the appropriate shape. The mathematical
|
|
110
|
+
domains, parameter rules and numerical behavior are inherited from the
|
|
111
|
+
vector implementations. This module uses iteration over vectors, not
|
|
112
|
+
vectorized implementations of the aggregation formulas.
|
|
113
|
+
|
|
66
114
|
Aggregation functions
|
|
67
115
|
---------------------
|
|
68
116
|
|
|
@@ -123,10 +171,11 @@ Each constructor returns a monotone fuzzy measure with
|
|
|
123
171
|
:math:`\mu(A)=\sum_{j=1}^{|A|}w_j`. The normalized weights are applied
|
|
124
172
|
by descending value rank, so the first belongs to the largest value;
|
|
125
173
|
with the Choquet integral this capacity gives the OWA aggregation.
|
|
126
|
-
- **Exponential cardinality**
|
|
174
|
+
- **Exponential cardinality**
|
|
175
|
+
(``exponential_cardinality_measure(n, q=1)``):
|
|
127
176
|
:math:`\mu(A)=(|A|/n)^q`, where ``q`` must be finite and :math:`q>0`.
|
|
128
|
-
For :math:`q=1`, this is the uniform/cardinality measure, and the
|
|
129
|
-
Choquet integral equals the arithmetic mean.
|
|
177
|
+
For :math:`q=1`, this is the uniform/cardinality measure, and the
|
|
178
|
+
discrete Choquet integral equals the arithmetic mean.
|
|
130
179
|
|
|
131
180
|
The constructors are in ``aggregationslib.aggregation``; Decimal
|
|
132
181
|
equivalents are available in ``aggregationslib.decimalaggregations``.
|
|
@@ -179,7 +228,8 @@ available in ``aggregationslib.aggregation`` and
|
|
|
179
228
|
by descending value rank, so the first belongs to the largest value.
|
|
180
229
|
In the Sugeno integral this capacity is used in the max–min formula;
|
|
181
230
|
the result is not the OWA aggregation.
|
|
182
|
-
- **Exponential cardinality**
|
|
231
|
+
- **Exponential cardinality**
|
|
232
|
+
(``exponential_cardinality_measure(n, q=1)``):
|
|
183
233
|
:math:`\mu(A)=(|A|/n)^q`, where ``q`` must be finite and :math:`q>0`.
|
|
184
234
|
For :math:`q=1`, this is the uniform/cardinality measure.
|
|
185
235
|
|
|
@@ -374,3 +424,15 @@ References
|
|
|
374
424
|
Averaging Functions*. Berlin: Springer, vol. 329, 2016.
|
|
375
425
|
2. `Mustonen, Seppo. (2010). Logarithmic mean for several
|
|
376
426
|
arguments. <https://www.researchgate.net/publication/228886844_Logarithmic_mean_for_several_arguments>`__
|
|
427
|
+
|
|
428
|
+
Shiny app
|
|
429
|
+
=========
|
|
430
|
+
|
|
431
|
+
A local interface lets you upload a CSV table, select columns and an
|
|
432
|
+
aggregation, add input vectors, and download row-wise results. It also
|
|
433
|
+
generates the equivalent Python code using ``aggregationslib.ndarray``.
|
|
434
|
+
See `setup and
|
|
435
|
+
usage <https://github.com/wgalka/Means/blob/main/apps/shiny/README.md>`__.
|
|
436
|
+
|
|
437
|
+
.. |Classification of aggregation functions| image:: https://raw.githubusercontent.com/wgalka/Means/main/docs/assets/diagram-aggregation-classification.svg
|
|
438
|
+
:target: https://wgalka.github.io/Means/aggregation_classification.html
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aggregationslib
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.9
|
|
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
|
|
@@ -32,26 +32,31 @@ Means, Aggregation functions...
|
|
|
32
32
|
|
|
33
33
|
Documentation:
|
|
34
34
|
|
|
35
|
-
- English
|
|
36
|
-
- Polski
|
|
35
|
+
- `English <https://wgalka.github.io/Means/en/>`__
|
|
36
|
+
- `Polski <https://wgalka.github.io/Means/pl/>`__
|
|
37
37
|
|
|
38
|
-
Aggregation functions can be classified in several ways. A familiar
|
|
39
|
-
is between three types of behaviour:
|
|
38
|
+
Aggregation functions can be classified in several ways. A familiar
|
|
39
|
+
distinction is between three types of behaviour:
|
|
40
40
|
|
|
41
41
|
- Conjunctive — an AND-like combination of the inputs.
|
|
42
42
|
- Averaging — a result between the smallest and largest input values.
|
|
43
43
|
- Disjunctive — an OR-like combination of the inputs.
|
|
44
44
|
|
|
45
|
-
These are not the only possibilities: aggregation functions can also
|
|
46
|
-
mixed behaviour. The diagram below presents a broader
|
|
45
|
+
These are not the only possibilities: aggregation functions can also
|
|
46
|
+
exhibit mixed behaviour. The diagram below presents a broader
|
|
47
|
+
classification.
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
:alt: Classification of aggregation functions
|
|
50
|
-
:target: https://wgalka.github.io/Means/aggregation_classification.html
|
|
49
|
+
|Classification of aggregation functions|
|
|
51
50
|
|
|
52
|
-
*Diagram elaborated on the basis of: A. Pradera, G. Beliakov, H.
|
|
51
|
+
*Diagram elaborated on the basis of: A. Pradera, G. Beliakov, H.
|
|
52
|
+
Bustince, B. De Baets, "A review of the relationships between
|
|
53
|
+
implication, negation and aggregation functions from the point of view
|
|
54
|
+
of material implication", Information Sciences 329 (2016) 357–380,*
|
|
55
|
+
`DOI:
|
|
56
|
+
10.1016/j.ins.2015.09.033 <https://doi.org/10.1016/j.ins.2015.09.033>`__\ *.*
|
|
53
57
|
|
|
54
|
-
An interactive version of this diagram is available at:
|
|
58
|
+
An interactive version of this diagram is available at:
|
|
59
|
+
https://wgalka.github.io/Means/aggregation_classification.html
|
|
55
60
|
|
|
56
61
|
Example 1:
|
|
57
62
|
^^^^^^^^^^
|
|
@@ -90,6 +95,49 @@ or '**repr**\ ()' methods.
|
|
|
90
95
|
print(func3.__repr__()) # function parameters are printed in order: func1, func2
|
|
91
96
|
>>>A_arpw(r=3)
|
|
92
97
|
|
|
98
|
+
Multidimensional arrays
|
|
99
|
+
-----------------------
|
|
100
|
+
|
|
101
|
+
``aggregationslib.ndarray`` provides the same ``A_...`` objects as
|
|
102
|
+
``aggregationslib.aggregations``, with additional constructor options
|
|
103
|
+
``axis`` and ``keepdims``. It applies the existing vector implementation
|
|
104
|
+
separately to each vector along the selected axis.
|
|
105
|
+
|
|
106
|
+
.. code:: python
|
|
107
|
+
|
|
108
|
+
import numpy as np
|
|
109
|
+
from aggregationslib.ndarray import A_ar, A_ch
|
|
110
|
+
from aggregationslib import weighted_measure
|
|
111
|
+
|
|
112
|
+
X = np.array([[0.2, 0.6, 0.9], [0.9, 0.2, 0.6]])
|
|
113
|
+
A_ar(axis=1)(X) # shape (2,): one value per row
|
|
114
|
+
A_ar(axis=0)(X) # shape (3,): one value per column
|
|
115
|
+
A_ar(axis=1, keepdims=True)(X) # shape (2, 1)
|
|
116
|
+
A_ar()(X) # scalar: aggregate all elements
|
|
117
|
+
|
|
118
|
+
mu = weighted_measure([0.5, 0.3, 0.2])
|
|
119
|
+
A_ch(measure=mu, axis=-1)(X) # array([0.46, 0.63])
|
|
120
|
+
|
|
121
|
+
``axis=None`` (the default) flattens the input in C order. An integer
|
|
122
|
+
axis, including a negative index, reduces that axis; tuples of axes are
|
|
123
|
+
not supported. For an input of shape ``(m, n)``, ``axis=1`` returns
|
|
124
|
+
shape ``(m,)``, including ``(1,)`` when there is just one row.
|
|
125
|
+
``keepdims=True`` retains reduced dimensions with length one. A complete
|
|
126
|
+
reduction returns a scalar unless ``keepdims=True``.
|
|
127
|
+
|
|
128
|
+
Choquet and Sugeno use the same measure for each vector. Its size must
|
|
129
|
+
match the selected axis length, or the total element count for
|
|
130
|
+
``axis=None``. Choquet's ``quasi_overlap`` continues to accept scalar
|
|
131
|
+
callbacks. ``Combine2Aggregations`` accepts vector callables or objects
|
|
132
|
+
from this module; the combination's own ``axis`` and ``keepdims``
|
|
133
|
+
control the reduction.
|
|
134
|
+
|
|
135
|
+
Empty vectors are rejected. An empty batch of nonempty vectors returns
|
|
136
|
+
an empty floating-point array of the appropriate shape. The mathematical
|
|
137
|
+
domains, parameter rules and numerical behavior are inherited from the
|
|
138
|
+
vector implementations. This module uses iteration over vectors, not
|
|
139
|
+
vectorized implementations of the aggregation formulas.
|
|
140
|
+
|
|
93
141
|
Aggregation functions
|
|
94
142
|
---------------------
|
|
95
143
|
|
|
@@ -150,10 +198,11 @@ Each constructor returns a monotone fuzzy measure with
|
|
|
150
198
|
:math:`\mu(A)=\sum_{j=1}^{|A|}w_j`. The normalized weights are applied
|
|
151
199
|
by descending value rank, so the first belongs to the largest value;
|
|
152
200
|
with the Choquet integral this capacity gives the OWA aggregation.
|
|
153
|
-
- **Exponential cardinality**
|
|
201
|
+
- **Exponential cardinality**
|
|
202
|
+
(``exponential_cardinality_measure(n, q=1)``):
|
|
154
203
|
:math:`\mu(A)=(|A|/n)^q`, where ``q`` must be finite and :math:`q>0`.
|
|
155
|
-
For :math:`q=1`, this is the uniform/cardinality measure, and the
|
|
156
|
-
Choquet integral equals the arithmetic mean.
|
|
204
|
+
For :math:`q=1`, this is the uniform/cardinality measure, and the
|
|
205
|
+
discrete Choquet integral equals the arithmetic mean.
|
|
157
206
|
|
|
158
207
|
The constructors are in ``aggregationslib.aggregation``; Decimal
|
|
159
208
|
equivalents are available in ``aggregationslib.decimalaggregations``.
|
|
@@ -206,7 +255,8 @@ available in ``aggregationslib.aggregation`` and
|
|
|
206
255
|
by descending value rank, so the first belongs to the largest value.
|
|
207
256
|
In the Sugeno integral this capacity is used in the max–min formula;
|
|
208
257
|
the result is not the OWA aggregation.
|
|
209
|
-
- **Exponential cardinality**
|
|
258
|
+
- **Exponential cardinality**
|
|
259
|
+
(``exponential_cardinality_measure(n, q=1)``):
|
|
210
260
|
:math:`\mu(A)=(|A|/n)^q`, where ``q`` must be finite and :math:`q>0`.
|
|
211
261
|
For :math:`q=1`, this is the uniform/cardinality measure.
|
|
212
262
|
|
|
@@ -401,3 +451,15 @@ References
|
|
|
401
451
|
Averaging Functions*. Berlin: Springer, vol. 329, 2016.
|
|
402
452
|
2. `Mustonen, Seppo. (2010). Logarithmic mean for several
|
|
403
453
|
arguments. <https://www.researchgate.net/publication/228886844_Logarithmic_mean_for_several_arguments>`__
|
|
454
|
+
|
|
455
|
+
Shiny app
|
|
456
|
+
=========
|
|
457
|
+
|
|
458
|
+
A local interface lets you upload a CSV table, select columns and an
|
|
459
|
+
aggregation, add input vectors, and download row-wise results. It also
|
|
460
|
+
generates the equivalent Python code using ``aggregationslib.ndarray``.
|
|
461
|
+
See `setup and
|
|
462
|
+
usage <https://github.com/wgalka/Means/blob/main/apps/shiny/README.md>`__.
|
|
463
|
+
|
|
464
|
+
.. |Classification of aggregation functions| image:: https://raw.githubusercontent.com/wgalka/Means/main/docs/assets/diagram-aggregation-classification.svg
|
|
465
|
+
:target: https://wgalka.github.io/Means/aggregation_classification.html
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
.gitignore
|
|
2
|
+
AGENTS.md
|
|
2
3
|
LICENSE
|
|
3
4
|
README.md
|
|
4
5
|
README.pl.md
|
|
@@ -40,6 +41,7 @@ aggregationslib/models/ensemble/__init__.py
|
|
|
40
41
|
aggregationslib/models/ensemble/aggregation_regressor.py
|
|
41
42
|
aggregationslib/models/single/__init__.py
|
|
42
43
|
apps/shiny/README.md
|
|
44
|
+
apps/shiny/README.pl.md
|
|
43
45
|
apps/shiny/app.py
|
|
44
46
|
apps/shiny/column-selection.js
|
|
45
47
|
apps/shiny/core.py
|
|
@@ -49,6 +51,7 @@ assets/icons/icon.ico
|
|
|
49
51
|
assets/icons/icon.png
|
|
50
52
|
assets/icons/icon.svg
|
|
51
53
|
docs/.nojekyll
|
|
54
|
+
docs/CNAME
|
|
52
55
|
docs/aggregation-classes.md
|
|
53
56
|
docs/aggregation-plots.md
|
|
54
57
|
docs/aggregation_classification.html
|
|
@@ -59,6 +62,7 @@ docs/assets/aggregation-surfaces-all.png
|
|
|
59
62
|
docs/assets/aggregation-surfaces.png
|
|
60
63
|
docs/assets/diagram-aggregation-classification.svg
|
|
61
64
|
docs/assets/diagram-klasyfikacja-agregacji.svg
|
|
65
|
+
docs/assets/means-icon.svg
|
|
62
66
|
docs/assets/site.css
|
|
63
67
|
docs/assets/aggregations/A_amn_p=0.5.png
|
|
64
68
|
docs/assets/aggregations/A_amx_p=0.5.png
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": [
|
|
3
3
|
".gitignore",
|
|
4
|
+
"AGENTS.md",
|
|
4
5
|
"LICENSE",
|
|
5
6
|
"README.md",
|
|
6
7
|
"README.pl.md",
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
"aggregationslib\\ndarray.py",
|
|
26
27
|
"aggregationslib\\purepython.py",
|
|
27
28
|
"apps\\shiny\\README.md",
|
|
29
|
+
"apps\\shiny\\README.pl.md",
|
|
28
30
|
"apps\\shiny\\app.py",
|
|
29
31
|
"apps\\shiny\\column-selection.js",
|
|
30
32
|
"apps\\shiny\\core.py",
|
|
@@ -40,6 +42,7 @@
|
|
|
40
42
|
"diagram-klasyfikacja-agregacji.svg",
|
|
41
43
|
"diagram-odwzorowanie.svg",
|
|
42
44
|
"docs\\.nojekyll",
|
|
45
|
+
"docs\\CNAME",
|
|
43
46
|
"docs\\aggregation-classes.md",
|
|
44
47
|
"docs\\aggregation-plots.md",
|
|
45
48
|
"docs\\aggregation_classification.html",
|
|
@@ -65,6 +68,7 @@
|
|
|
65
68
|
"docs\\assets\\aggregations\\A_qd.png",
|
|
66
69
|
"docs\\assets\\diagram-aggregation-classification.svg",
|
|
67
70
|
"docs\\assets\\diagram-klasyfikacja-agregacji.svg",
|
|
71
|
+
"docs\\assets\\means-icon.svg",
|
|
68
72
|
"docs\\assets\\site.css",
|
|
69
73
|
"docs\\en\\index.html",
|
|
70
74
|
"docs\\fuzzy-integrals.md",
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Shiny App
|
|
2
|
+
|
|
3
|
+
Graphical interface for computing aggregation functions on tabular data and evaluating binary classification.
|
|
4
|
+
|
|
5
|
+
*Wersja polska: [README.pl.md](https://github.com/wgalka/Means/blob/main/apps/shiny/README.pl.md)*
|
|
6
|
+
|
|
7
|
+
## Getting Started
|
|
8
|
+
|
|
9
|
+
Install the library from the repository root:
|
|
10
|
+
|
|
11
|
+
```powershell
|
|
12
|
+
python -m pip install .
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Launch the application with:
|
|
16
|
+
|
|
17
|
+
```powershell
|
|
18
|
+
agglib start
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
If the environment is missing packages required by the interface (`shiny`, `pandas`, `matplotlib`, `scikit-learn`, `pygments`), the CLI will ask whether to install them:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
Install the graphical interface? [Y/n]
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
You can also install all dependencies upfront:
|
|
28
|
+
|
|
29
|
+
```powershell
|
|
30
|
+
python -m pip install ".[app]"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The `agglib serve` command works identically to `agglib start`. Press `Ctrl+C` to stop the server.
|
|
34
|
+
|
|
35
|
+
> **Test mode:** Appending `?tester=1` to the browser URL (e.g. `http://127.0.0.1:8000/?tester=1`) automatically loads the sample dataset `example.csv` along with ground truth labels.
|
|
36
|
+
|
|
37
|
+
## Working with Data
|
|
38
|
+
|
|
39
|
+
1. **Upload a file** – upload a CSV file and choose the column separator and decimal separator. Each row is treated as a separate vector to aggregate.
|
|
40
|
+
2. **Additional vectors** – in the collapsible *Additional vectors* section, you can enter custom rows (one vector per line, space-separated values, dot as the decimal separator).
|
|
41
|
+
3. **Column selection** – in the data preview, use the checkboxes in column headers to select which columns to include in calculations (text columns such as identifiers should be unchecked). Clicking a column name sorts the table preview.
|
|
42
|
+
|
|
43
|
+
By default, the preview shows the first 5 and last 5 rows (`5 … 5`), with an option to switch to the full table (`All rows`, capped at 2,000 rows in the browser view). Sorting and truncating the preview do not affect the row order in calculations or exports.
|
|
44
|
+
|
|
45
|
+
Uploaded CSV files are validated before loading (up to 20 MB and 100,000 rows), and each task checks estimated memory usage and method complexity before entering the queue. Aggregations run asynchronously in a bounded background queue with a live progress bar.
|
|
46
|
+
|
|
47
|
+
## Aggregations and Weights
|
|
48
|
+
|
|
49
|
+
All 20 aggregation functions from `aggregationslib.ndarray` are available, including the Choquet (`A_ch`) and Sugeno (`A_sg`) fuzzy integrals with six types of measures:
|
|
50
|
+
|
|
51
|
+
- **weighted** and **k-fuzzy** – weight inputs appear directly above the selected columns (for the weighted measure, weights must sum to 1).
|
|
52
|
+
- **owa** – weights are assigned to positions after sorting values from largest to smallest (weights must sum to 1).
|
|
53
|
+
- **exponential_cardinality** – takes a single parameter $q > 0$.
|
|
54
|
+
- **uniform** and **relative** – measures that do not require additional weights.
|
|
55
|
+
|
|
56
|
+
Because measure constructors generate subsets, the `weighted`, `owa`, and `k-fuzzy` variants are limited to 12 selected columns in the interface. Input data are not automatically normalized, and missing values (`NaN`) or infinite values in selected columns are reported as errors.
|
|
57
|
+
|
|
58
|
+
At the bottom of the form, you can download the resulting CSV file (containing the original columns plus the computed result) as well as ready-to-run, standalone Python code reproducing the calculations.
|
|
59
|
+
|
|
60
|
+
## Classification Evaluation
|
|
61
|
+
|
|
62
|
+
In the *Ground truth labels* section, you can provide true class labels (by pasting them as text or uploading a CSV file) to evaluate binary classification based on the aggregation scores:
|
|
63
|
+
|
|
64
|
+
- Labels must match the data rows in order (including manually appended vectors) and contain exactly two classes.
|
|
65
|
+
- Specify the positive class label (default `1`) and choose whether a higher aggregation score indicates the positive or negative class.
|
|
66
|
+
|
|
67
|
+
Once labels are provided, the application computes:
|
|
68
|
+
- **ROC curve** together with the area under the curve (ROC AUC),
|
|
69
|
+
- **Optimal cutoff threshold ($t$)** according to the selected criterion: Youden's index ($J = \text{TPR} - \text{FPR}$), Accuracy, or F1 score. The threshold can also be set manually in *Manual* mode,
|
|
70
|
+
- **Metrics summary**: Average Precision, Accuracy, Balanced Accuracy, Precision, Recall, Specificity, NPV, F1 (for the positive class as well as micro/macro/weighted variants), MCC, and Cohen's $\kappa$ (metric names in the table link to `scikit-learn` documentation),
|
|
71
|
+
- **Confusion matrices** displayed as heatmaps (raw counts and row-normalized percentages per true class).
|