# `AbruptDrift`

### *class* capymoa.stream.drift.AbruptDrift[[source]](https://github.com/adaptive-machine-learning/CapyMOA/blob/3e255b1/src/capymoa/stream/drift.py#L978)

Bases: [`Drift`](capymoa.stream.drift.Drift.md#capymoa.stream.drift.Drift)

An instantaneous change of concept at `position`.

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

`position` may be omitted only in the *range* form of
[`DriftStream`](capymoa.stream.drift.DriftStream.md#capymoa.stream.drift.DriftStream), where the lengths of the surrounding
[`Concept`](capymoa.stream.drift.Concept.md#capymoa.stream.drift.Concept) objects decide where the drift lands:

```pycon
>>> print(AbruptDrift())
AbruptDrift()
```

A [`DriftStream`](capymoa.stream.drift.DriftStream.md#capymoa.stream.drift.DriftStream) built from positions rejects a drift without one,
so an omitted position cannot quietly become a drift at instance zero.

#### \_\_init_\_(position: [int](https://docs.python.org/3/builtins/functions.html#int) | [None](https://docs.python.org/3/builtins/constants.html#None) = None, random_seed: [int](https://docs.python.org/3/builtins/functions.html#int) = 1)[[source]](https://github.com/adaptive-machine-learning/CapyMOA/blob/3e255b1/src/capymoa/stream/drift.py#L996)

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.
