github yzhao062/pyod v3.6.8

34 minutes ago

PyOD 3.6.8

A maintenance release with scoring, estimator-contract and input-validation fixes. Default scores change for LODA, DevNet and fast ABOD; see Score Changes. No new detector or dependency is introduced.

Score Changes

  • LODA: scoring now looks up the interior histogram edges. It previously searched the first n_bins - 1 edges, so on cardio, pima and shuttle 89 to 100 percent of bin lookups read the wrong density. Mean ROC AUC over seeds 0 to 4 rises from 0.85 to 0.92 on cardio, 0.60 to 0.66 on pima, and 0.33 to 0.99 on shuttle. #777.
  • DevNet: fit called deviation_loss(outputs, labels) against the signature deviation_loss(y_true, y_pred), so training never used the labels. Test ROC AUC on cardio, pima and shuttle (60/40 stratified splits, three seeds, 20 epochs) rises from 0.05, 0.38 and 0.04 to 0.99, 0.81 and 0.99.
  • Fast ABOD: a training point no longer counts as its own neighbor, so decision_scores_, threshold_ and labels_ are leave-self-out. Duplicate rows (#420) can still yield NaN. #774.

Bug Fixes

  • DevNet: add a class docstring; random_seed, known_outliers and data_format now take effect; nb_batch and cont_rate are deprecated with a DeprecationWarning. Importing the module no longer seeds NumPy and torch, and fit seeds torch and a local RandomState only. known_outliers defaults to None, which keeps training on every labeled anomaly; an integer caps the labeled set. #720, fixes #714.
  • ECOD and COPOD: validate X as float64 or float32 in fit and decision_function, so integer, boolean and pandas nullable input no longer wraps, overflows or crashes when negated for the right tail. Float input is scored as before. A refit no longer scores the new data against the previous training set. Fixes #764, fixes #497.
  • KNN and KDE: build NearestNeighbors and KernelDensity in fit, so set_params takes effect. Scores for constructor parameters are unchanged. Fixes #783.
  • DeepSVDD: validation_size is documented as unused, and fit emits a FutureWarning when it differs from the default 0.1. random_state accepts a RandomState, and torch is seeded in fit, so a refit with an integer seed repeats the run. First-fit scores match 3.6.7 up to float rounding. Fixes #757.
  • KPCA: with sampling=True, decision_scores_, labels_ and threshold_ cover every training row in input order instead of the sampled basis only; scoring every row adds fit time linear in n for a fixed basis size, such as the default subset_size=20. #776.
  • Deep detectors: detectors built on BaseDeepLearningDetector fit datasets smaller than one batch instead of raising UnboundLocalError. #769, fixes #768.
  • precision_n_scores: share the remaining rank positions across scores tied at the cutoff, and reject invalid input with ValueError. get_label_n and score_to_label still drop a tied block at the cutoff. #761, fixes #760.
  • SO_GAAL: store criterion_name so clone() works. Fixes #758.

Documentation

  • generate_data_clusters lists its return values in the order returned and describes the return_in_clusters output correctly. From #646.

Behavior Notes

ECOD and COPOD cast integers to float64, so integers above 2**53 lose precision. A DevNet fit with the default random_seed=42 is reproducible but seeds torch's global generator. DeepSVDD validation_size has never changed training; fit now warns when it differs from the default 0.1.

Contributors

Thanks to @antonsoo, @bishtashish708, @raashish1601, @aminmiral, @Iams4kura, @shaurya416, @RealDream21, @AHMETHAKANBEZIR1, @rdriskill1234, @AryanRG, and @owgreen-dev.

Full changelog: v3.6.7...v3.6.8

Don't miss a new pyod release

NewReleases is sending notifications on new releases.