Ranking#

A Ranking anomaly detector is one that is able to assign arbitrary scores to samples in a dataset. The samples can then be sorted by their score and the top k samples can be selected for further analysis.

Score a Dataset#

Apply an arbitrary unnormalized scoring function over the dataset:

public rank(Dataset $dataset) : array

Example

$scores = $estimator->rank($dataset);

var_dump($scores);
array(3) {
  [0]=> float(0.35033859096744)
  [1]=> float(0.40992076925443)
  [2]=> float(0.68163357834096)
}

Rank a Single Sample#

Return the score given to a single sample:

public rankSample(array $sample) : float

Example

$score = $estimator->rankSample($dataset[1]);

var_dump($score);
float(0.39431742584649)