Anomaly Detection
Half Space Trees

Half-Space Trees (HST)

Half-space trees are an online variant of isolation forests. They work well when anomalies are spread out. However, they do not work well if anomalies are packed together in windows.

By default, we apply MinMax scaling to the inputs to ensure each feature has values that are comprised between 0 and 1.

Note that high scores indicate anomalies, whereas low scores indicate normal observations.

Parameters

  • n_trees(Default:20) → Number of trees to use.

  • height(Default:12) → Height of each tree. Note that a tree of height h is made up of h + 1 levels and therefore contains 2 ** (h + 1) - 1 nodes.

  • window_size(Default:50) → Number of observations to use for calculating the mass at each node in each tree.

Example Usage

import turboml as tb
hst_model = tb.HST()