Commit Graph

41 Commits

Author SHA1 Message Date
Alejandro Moreo Fernandez 2a50fe902c Fix broken imports left over from the BBSE/LEIP commit
quapy/classification/__init__.py imported a labelshift module that doesn't exist
anywhere in the repo (and nothing else references it), breaking `import quapy`
entirely; the import is removed.

quapy/method/aggregative.py imported a nonexistent `_liep` module instead of the
actual file, _liep_draft.py, which itself never got a LEIP class added (only
helper functions such as leip()). Guards the import so LEIP degrades to an
"not available" placeholder, like the other optional neural methods, instead of
crashing the whole package. test_leip/test_leip_fixed_tau still fail as a result;
finishing LEIP is left for a follow-up.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-08 14:47:13 +02:00
Alejandro Moreo Fernandez d046681986 added bbse hard and soft and classifier adaptation wrapper 2026-08-26 18:08:37 +02:00
Alejandro Moreo Fernandez d904c2ce24 add random_state to calibration classes, fix flaky calibration test
fit_tr_val's train_test_split had no random_state, so val_split=float
picked a different split every run; occasionally the split produced a
posterior distribution that made abstention's temperature-scaling
L-BFGS optimizer diverge to NaN. Threaded random_state through the
base class and all four calibrator subclasses, and pinned the test to
a seed confirmed stable across repeated runs.
2026-07-20 11:16:43 +02:00
Alejandro Moreo Fernandez ed02be2c8d Add smoke tests for previously-untested modules, fix wasteful svmperf tmpdir creation
- Add smoke tests covering data/reader.py, method/_threshold_optim.py,
  classification/calibration.py, method/confidence.py, and the pure-numpy
  helpers in method/_bayesian.py (skipping the jax/stan-dependent model
  code itself, consistent with how the aggregative-method registry already
  treats it as optional)
- SVMperf: stop creating a tempfile.TemporaryDirectory() just to discard it
  immediately for its .name; generate the path directly instead of doing a
  pointless create/delete/recreate cycle (cleanup already happens via the
  class's own __del__)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-04 19:05:06 +02:00
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 e44056d860 integrating bayesian methods and related functionality, plus unit test refactor 2026-06-05 14:08:06 +02:00
Alejandro Moreo Fernandez 24ab704661 all examples but 15 (qunfold) properly working 2025-10-01 17:41:36 +02:00
Alejandro Moreo Fernandez e870d798b7 fango 2023-11-15 10:55:13 +01:00
Alejandro Moreo Fernandez 25f1cc29a3 refactoring aggregative quantifiers 2023-11-12 13:04:19 +01:00
Alejandro Moreo Fernandez 67906f6f2d adding uci_experiments to examples folder 2023-03-23 15:46:03 +01:00
Alejandro Moreo Fernandez de93cce391 Merge branch 'master' of github.com:HLT-ISTI/QuaPy 2023-02-28 10:27:47 +01:00
Alejandro Moreo Fernandez 368ee03fbc some minor improvements 2023-02-28 10:25:46 +01:00
Andrea Esuli e9d56e5801
missing argument
Added missing deep argument to get_params of LowRankLogisticRegression
2023-02-28 08:41:34 +01:00
Alejandro Moreo Fernandez e0718b6e1b merging from protocols (aka v0.1.7) 2023-02-14 18:13:21 +01:00
Alejandro Moreo Fernandez c608647475 some bug fixes here and there 2023-02-13 19:27:48 +01:00
Alejandro Moreo Fernandez 505d2de823 elm examples 2023-02-13 12:01:52 +01:00
Alejandro Moreo Fernandez 7b2d3cb7f1 example using svmperf 2023-02-11 10:08:31 +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 09abcfc935 adding calibration methods from the abstension package to quapy 2023-01-18 19:46:19 +01:00
Alejandro Moreo Fernandez e40c409609 bugfix in NeuralClassifierTrainer; it was only configured to work well in binary problems 2022-10-04 11:03:08 +02:00
Alejandro Moreo Fernandez 3eb760901f doc update, official baselines for T1A and T1B refactored 2021-11-12 14:30:02 +01:00
Alejandro Moreo Fernandez f33abb5319 Merge branch 'master' of https://github.com/HLT-ISTI/QuaPy 2021-06-21 11:13:38 +02:00
Alejandro Moreo Fernandez a1cdc9ef43 fixing fit_learner=False case in QuaNet 2021-06-21 11:13:14 +02:00
Alejandro Moreo Fernandez 8cc11c0276
Merge pull request #6 from pglez82/master
fixing two problems with parameters: hidden_size and lstm_nlayers
2021-06-21 10:32:58 +02:00
Alejandro Moreo Fernandez e8c3e29911 svm-perf leaks model, fixing... 2021-06-15 07:49:16 +02:00
Alejandro Moreo Fernandez 9fd9d096f6 Merge branch 'master' of https://github.com/HLT-ISTI/QuaPy 2021-06-11 11:00:37 +02:00
Alejandro Moreo Fernandez 2e842a1d1f change in pcalr 2021-06-11 10:59:35 +02:00
Alejandro Moreo Fernandez 2586e6ed7d fix in PCALR 2021-06-11 10:52:30 +02:00
Pablo Gonzalez cb40b71a38 fixing two problems with parameters: hidden_size and lstm_nlayers 2021-06-07 12:22:06 +02:00
Andrea Esuli 70a3d4bd0f Tests for non aggregative and meta methods. 2021-05-04 12:14:14 +02:00
Alejandro Moreo Fernandez 854d759dc4 making everything work like in the wiki 2021-02-17 18:05:22 +01:00
Alejandro Moreo Fernandez 70da8f7925 updating the documentation 2021-02-16 19:38:52 +01:00
Alejandro Moreo Fernandez bf1cc74ba1 quapy fixed 2021-01-22 09:58:12 +01:00
Alejandro Moreo Fernandez 1399125fb8 adding QuaNet to experiments of Twitter; trying new stuff in 'NewMethods' 2021-01-18 19:14:04 +01:00
Alejandro Moreo Fernandez 5e64d2588a import fixes 2021-01-15 18:32:32 +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 d8e2f7556e QuaNet added, two examples of TextClassifiers added (CNN, LSTM) 2020-12-29 20:33:59 +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 78988c87f9 svmperf wrapper added 2020-12-03 16:59:13 +01:00