AbruptDrift#
- class capymoa.stream.drift.AbruptDrift[source]#
Bases:
DriftAn instantaneous change of concept at
position.>>> from capymoa.stream.drift import AbruptDrift >>> print(AbruptDrift(position=5000)) AbruptDrift(position=5000)
positionmay be omitted only in the range form ofDriftStream, where the lengths of the surroundingConceptobjects decide where the drift lands:>>> print(AbruptDrift()) AbruptDrift()
A
DriftStreambuilt 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
alphaparameter fails at the call site rather than silently becoming the seed.