decision_scores_ is a PyOD estimator attribute containing numeric outlier scores for every record used to fit the detector. It provides training-data scores after fit(), complementing labels_ for binary training labels. section 6.1
Use the common PyOD API to distinguish score sources and outputs:
- decision_scores_ returns numeric scores for the training records. section 6.1
- decision_function() returns numeric scores for separately supplied test records, while predict() returns binary labels. section 6.1
Listing 6.1 Basic example using PyOD with the KNN detector
from pyod.models.knn import KNN clf = KNN() clf.fit(data) scores = clf.decision_scores_
Shows the minimal KNN workflow: instantiate a detector, fit data, and read decision_scores_. section 6.1
