liveBook · Manning

Decision_scores_

As explained in Outlier Detection in Python

decision_scores_ is a PyOD estimator attribute containing numeric outlier scores for the training records.

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

How Outlier Detection in Python covers it

How deep it goes
Defines the attribute and distinguishes training scores from test scores, without detailing detector-specific scoring internals.
Examples
Uses PyOD KNN on synthetic clustered data, where outside-cluster points receive noticeably higher scores.
What it assumes
Assumes a dataset suitable for detector fitting and basic familiarity with PyOD's fit-and-score workflow.
What you can do after
Operate PyOD detectors by fitting data and retrieving numeric training scores for inspection or comparison.
How it connects
Connects fit(), labels_, decision_function(), predict(), predict_proba(), KNN, and KDE.

This explainer was generated by Manning's knowledge graph from the text of Outlier Detection in Python. The section links point to the parts of the book it draws on.