From eeaa6776b1449b4226d1e04d1b9823316b08cc9d Mon Sep 17 00:00:00 2001 From: Alejandro Moreo Date: Thu, 20 Aug 2026 18:11:07 +0200 Subject: [PATCH] updated manuals --- CHANGE_LOG.txt | 7 +++++++ TODO.txt | 14 -------------- docs/source/manuals/methods.md | 31 ++++++++++++++++++++++++++++++- 3 files changed, 37 insertions(+), 15 deletions(-) diff --git a/CHANGE_LOG.txt b/CHANGE_LOG.txt index a384d39..a364696 100644 --- a/CHANGE_LOG.txt +++ b/CHANGE_LOG.txt @@ -1,3 +1,10 @@ +Change Log 0.2.2 +----------------- + +- Added HistNetQ, based on the original implementation https://github.com/pglez84/histnetq + +- Minor fixes + Change Log 0.2.1 ----------------- diff --git a/TODO.txt b/TODO.txt index f522a47..17604ab 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,14 +1,7 @@ -Adapt examples; remaining: example 4-onwards -not working: 15 (qunfold) - -Solve the warnings issue; right now there is a warning ignore in method/__init__.py: - Add 'platt' to calib options in EMQ? Allow n_prevpoints in APP to be specified by a user-defined grid? -Update READMEs, wiki, & examples for new fit-predict interface - Add the fix suggested by Alexander: For a more general application, I would maybe first establish a per-class threshold value of plausible prevalence @@ -20,15 +13,8 @@ scale each value by per-class thresholds, i.e., [0.33*0.1, 0.33*1, 0.33*1]/sum. - This affects LabelledCollection - This functionality should be accessible via sampling protocols and evaluation functions -Solve the pre-trained classifier issues. An example is the coptic-codes script I did, which needed a mock_lr to -work for having access to classes_; think also the case in which the precomputed outputs are already generated -as in the unifying problems code. - - -- [TODO] document confidence in manuals - [TODO] Test the return_type="index" in protocols and finish the "distributing_samples.py" example - [TODO] add ensemble methods SC-MQ, MC-SQ, MC-MQ -- [TODO] add HistNetQ - [TODO] add CDE-iteration and Bayes-CDE methods - [TODO] add Friedman's method and DeBias - [TODO] check ignore warning stuff diff --git a/docs/source/manuals/methods.md b/docs/source/manuals/methods.md index 4d7d75e..b721957 100644 --- a/docs/source/manuals/methods.md +++ b/docs/source/manuals/methods.md @@ -851,7 +851,36 @@ model.fit(*dataset.training.Xy) estim_prevalence = model.predict(dataset.test.X) ``` -(confidence-regions-for-class-prevalence-estimation)= +### HistNetQ + +QuaPy offers an implementation of HistNetQ, a deep learning model based on a differentiable +histogram representation, presented in: + +[_Pérez-Mon, O., Moreo, A., del Coz, J.J., & González, P. (2025). +Quantification using permutation-invariant networks based on histograms. +Neural Computing and Applications, 37(5), 3505-3520._](https://doi.org/10.1007/s00521-024-10721-1) + +This model requires `torch` to be installed. Like QuaNet, HistNetQ is trained end-to-end on +samples ("bags") of known prevalence rather than on individually labeled instances; unlike QuaNet, +it requires no classifier at all, only an optional feature extraction module (a plain identity +module is used by default, for already-vectorized data). + +```python +import quapy as qp +from quapy.method.meta import HistNetQ + +dataset = qp.datasets.fetch_UCIBinaryDataset('haberman') + +model = HistNetQ(bag_size=100, device='cpu') +model.fit(*dataset.training.Xy) +estim_prevalence = model.predict(dataset.test.X) +``` + +HistNetQ can alternatively be trained directly from a protocol that already provides the training +samples (e.g., when only bag-level prevalence values are available), via the `fit_from_samples` +method; see the API documentation for further details. + + ## Quantifiers with Uncertainty Quantification _(New in v0.2.0!)_ Some quantification methods go beyond providing a single point estimate of class prevalence values and also produce confidence regions, which characterize the uncertainty around the point estimate. In QuaPy, two such families are currently implemented: bootstrap methods and Bayesian methods.