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 - 1edges, 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:
fitcalleddeviation_loss(outputs, labels)against the signaturedeviation_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_andlabels_are leave-self-out. Duplicate rows (#420) can still yield NaN. #774.
Bug Fixes
- DevNet: add a class docstring;
random_seed,known_outliersanddata_formatnow take effect;nb_batchandcont_rateare deprecated with aDeprecationWarning. Importing the module no longer seeds NumPy and torch, andfitseeds torch and a local RandomState only.known_outliersdefaults toNone, which keeps training on every labeled anomaly; an integer caps the labeled set. #720, fixes #714. - ECOD and COPOD: validate
Xas float64 or float32 infitanddecision_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
NearestNeighborsandKernelDensityinfit, soset_paramstakes effect. Scores for constructor parameters are unchanged. Fixes #783. - DeepSVDD:
validation_sizeis documented as unused, andfitemits aFutureWarningwhen it differs from the default 0.1.random_stateaccepts a RandomState, and torch is seeded infit, 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_andthreshold_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 defaultsubset_size=20. #776. - Deep detectors: detectors built on
BaseDeepLearningDetectorfit datasets smaller than one batch instead of raisingUnboundLocalError. #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_nandscore_to_labelstill drop a tied block at the cutoff. #761, fixes #760. - SO_GAAL: store
criterion_namesoclone()works. Fixes #758.
Documentation
generate_data_clusterslists its return values in the order returned and describes thereturn_in_clustersoutput 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