Commit Graph

25 Commits

Author SHA1 Message Date
Alejandro Moreo Fernandez b29966797a Fix 10 correctness bugs and clean up warnings/logging in core library
Correctness:
- OneVsAllAggregative.aggregation_fit: fix undefined variable and call to
  the nonexistent aggregate_fit (should be aggregation_fit)
- solve_adjustment: stop mutating the caller's fitted arrays in place for
  method='invariant-ratio'
- LabelledCollection.join(): fix classes always being None due to
  ndarray.sort() returning None; now unions each collection's own classes_
  so a class absent from a particular join is kept at zero prevalence
- Rename the duplicate newSVMKLD (nkld variant) to newSVMNKLD so both loss
  variants are reachable
- EMQ/DyS/DMy: resolve n_jobs via qp._get_njobs() like the other methods,
  so qp.environ['N_JOBS'] is respected
- AggregativeMedianEstimator: drop backend='threading' (global np.random
  state mutated via temp_seed is not thread-safe); use the safe process
  based default instead
- NeuralClassifier: default device now 'cpu', matching its own docstring
- ConfidenceEllipseSimplex: narrow bare except to np.linalg.LinAlgError
- SVMperf: stop merging stderr into stdout so failures report the actual
  subprocess error instead of crashing with AttributeError
- ConfidenceRegionABC: replace @lru_cache on bound methods (leaked every
  instance for the process lifetime) with per-instance caching

Style/quality:
- Replace print() with warnings.warn()/logging across aggregative.py,
  base.py, meta.py, model_selection.py, classification/neural.py,
  method/_neural.py, classification/svmperf.py, data/reader.py,
  data/datasets.py; also fixes a `raise RuntimeWarning(...)` in EMQ that
  would have crashed instead of warning
- Remove dead duplicate class MedianEstimator2 in meta.py
- Rename misleading _compute_tpr(TP, FP) parameter to FN, matching what
  callers actually pass
- Replace argparse.ArgumentError misuse with ValueError
- Remove commented-out dead code in protocol.py
- _lequa.py: fix CSV-parse failure raising an unrelated UnboundLocalError
  instead of a clear ValueError

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-04 18:49:44 +02:00
Alejandro Moreo Fernandez 3c16536b3d cleaning examples 2025-09-26 15:22:41 +02:00
Alejandro Moreo Fernandez e76e1de6a9 refactoring codebase 2025-05-23 12:27:49 +02:00
Alejandro Moreo Fernandez 075be93a23 refactoring w/o labelled collection 2025-04-20 22:05:46 +02:00
Alejandro Moreo Fernandez 561b672200 updated unit tests 2024-04-16 15:12:22 +02:00
Alejandro Moreo Fernandez 0a6185d908 refactoring the aggregative quantifiers 2023-11-12 14:45:03 +01:00
Alejandro Moreo Fernandez 505d2de823 elm examples 2023-02-13 12:01:52 +01:00
Alejandro Moreo Fernandez 952cf5e767 fixing bugs in one-vs-all 2023-02-10 19:02:17 +01:00
Alejandro Moreo Fernandez e28abfc362 more examples, one-vs-all fixed 2023-02-09 19:39:16 +01:00
Alejandro Moreo Fernandez 2485117f05 adding documentation and adding one new example 2023-02-08 19:06:53 +01:00
Alejandro Moreo Fernandez f9a199d859 fixing hyperparameters with prefixes, and replacing learner with classifier in aggregative quantifiers 2023-01-27 18:13:23 +01:00
Alejandro Moreo Fernandez 2cc7db60cc updating parallel policy to take n_jobs from environment (not yet tested) 2022-06-14 09:35:39 +02:00
Alejandro Moreo Fernandez eba6fd8123 optimization conditional in the prediction function 2022-05-26 17:59:23 +02:00
Alejandro Moreo Fernandez 4bc9d19635 many changes, see change log 2022-05-25 19:14:33 +02:00
Alejandro Moreo Fernandez 3835f89e9d adding documentation 2021-12-15 15:27:43 +01:00
Alejandro Moreo Fernandez 8239947746 refit=True default value in GridSearchQ 2021-06-16 13:53:54 +02:00
Andrea Esuli 5b772c7eda Bug fixes on use of classes_. Tests. 2021-05-05 17:12:44 +02:00
Andrea Esuli bfbfe08116 Added classes_ property to all quantifiers. 2021-05-04 17:09:13 +02:00
Alejandro Moreo Fernandez b30c40b7a0 some refactor made in order to accomodate OneVsAll to operate with aggregative probabilistic quantifiers; launching OneVsAll(HDy) 2021-01-18 16:52:19 +01:00
Alejandro Moreo Fernandez 5e64d2588a import fixes 2021-01-15 18:32:32 +01:00
Alejandro Moreo Fernandez d1b449d2e9 plot functionality added 2021-01-07 17:58:48 +01:00
Alejandro Moreo Fernandez 326a8ab803 added Ensemble methods (methods ALL, ACC, Ptr, DS from Pérez-Gallego et al 2017 and 2019) and some UCI ML datasets used in those articles (only 5 datasets out of 32 they used) 2021-01-06 14:58:29 +01:00
Alejandro Moreo Fernandez c8a1a70c8a refactoring aggregative methods as methods that not only implement 'classify' and 'quantify', but that also implement 'aggregate' and that, by default, have a default implementation of 'quantify' as a pipeline of 'classify' and 'aggregate'; this helps speeding up evaluations A LOT, since the documents can be pre-classified and the samples are carried out across pre-classified values (labels, or posterior probabilities), and thus only aggregate is called many times within the artificial sampling protocol 2020-12-11 19:28:17 +01:00
Alejandro Moreo Fernandez 9bc3a9f28a evaluation by artificial prevalence sampling added. New methods added. New util functions added to quapy.functional and quapy.utils 2020-12-10 19:04:33 +01:00
Alejandro Moreo Fernandez a882424eeb many aggregative methods added 2020-12-03 18:12:28 +01:00