API reference

andrey.data.missingness.mcar#

andrey.data.missingness.mcar(rate, *, observed=0.0)[source]#

Values missing completely at random.

Each value of a column that can go missing is missing with probability rate, whatever the data.

Parameters:
  • rate (float) – The probability that a value is missing, in (0, 1).

  • observed (float) – The share of the columns that are always observed, in [0, 1), rounded to a whole number of columns; which ones is drawn.

Return type:

Mechanism

Raises:

ValueError – If rate is not in (0, 1) or observed is not in [0, 1).

Examples

>>> from andrey.data.missingness import mcar
>>> mcar(0.1).name
'mcar'