AbruptDrift#

class capymoa.stream.drift.AbruptDrift[source]#

Bases: Drift

An instantaneous change of concept at position.

>>> from capymoa.stream.drift import AbruptDrift
>>> print(AbruptDrift(position=5000))
AbruptDrift(position=5000)

position may be omitted only in the range form of DriftStream, where the lengths of the surrounding Concept objects decide where the drift lands:

>>> print(AbruptDrift())
AbruptDrift()

A DriftStream built from positions rejects a drift without one, so an omitted position cannot quietly become a drift at instance zero.

__init__(position: int = None, random_seed: int = 1)[source]#

Construct a drift in a DriftStream.

Parameters:
  • position – The location of the drift in terms of the number of instances processed prior to it occurring.

  • width – The size of the window of change. A width of 0 or 1 corresponds to an abrupt drift.

  • random_seed – Seed for random number generation, defaults to 1. Keyword-only, so a leftover positional argument from the removed alpha parameter fails at the call site rather than silently becoming the seed.