QuaPy/quapy/method
Alejandro Moreo Fernandez 24719ed0af Add HistNetQ, a differentiable-histogram neural quantifier
Ports the "hard" histogram variant of HistNetQ (from
https://github.com/pglez84/histnetq) into quapy/method/_histnet.py, dropping
that repo's quantificationlib-backed bag generators in favor of QuaPy's own
sampling protocols (UPP by default). Implemented as a BaseQuantifier,
alongside QuaNet, since it trains end-to-end on samples of known prevalence
rather than following the classify-then-aggregate pattern.

- HistNetQ.fit(X, y): resamples training/validation bags from a
  LabelledCollection via a configurable protocol (UPP by default; fresh
  random bags each training epoch, a fixed reproducible sequence for
  validation).
- HistNetQ.fit_from_samples(protocol, val_protocol=None, mix_bags=False):
  trains directly from a protocol that already yields bags (e.g. LeQua's
  SamplesFromDir), with an optional mixer to synthesize extra
  intermediate-prevalence bags from the given ones.
- Aliased in meta.py (torch-optional, mirroring the existing QuaNet guard)
  and registered in META_METHODS.
- Adds test_histnetq covering both entry points on binary and multiclass
  synthetic data.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-19 18:44:57 +02:00
..
stan index in labelled collection from versions restored 2025-11-15 17:56:37 +01:00
__init__.py Add HistNetQ, a differentiable-histogram neural quantifier 2026-08-19 18:44:57 +02:00
_bayesian.py downgrade missing-bayes-deps notice to debug level 2026-07-20 12:14:31 +02:00
_energy.py added EDx and improve doc 2026-07-07 15:46:45 +02:00
_helper.py adding EDy and improved manuals 2026-07-06 17:30:42 +02:00
_histnet.py Add HistNetQ, a differentiable-histogram neural quantifier 2026-08-19 18:44:57 +02:00
_kdey.py added dataset for images 2026-07-02 18:21:35 +02:00
_neural.py Fix 10 correctness bugs and clean up warnings/logging in core library 2026-07-04 18:49:44 +02:00
_threshold_optim.py Fix 10 correctness bugs and clean up warnings/logging in core library 2026-07-04 18:49:44 +02:00
aggregative.py added EDx and improve doc 2026-07-07 15:46:45 +02:00
base.py Fix 10 correctness bugs and clean up warnings/logging in core library 2026-07-04 18:49:44 +02:00
composable.py mergin and solving pytests 2025-10-06 12:03:31 +02:00
confidence.py improving doc manuals and added bonferroni parameter to interval construction 2026-07-06 12:11:24 +02:00
meta.py Add HistNetQ, a differentiable-histogram neural quantifier 2026-08-19 18:44:57 +02:00
non_aggregative.py added EDx and improve doc 2026-07-07 15:46:45 +02:00