API reference

andrey.data.missingness.self_masking#

andrey.data.missingness.self_masking(rate, *, observed=0.3, form='logistic')[source]#

Self-masking missing values.

Each indicator depends on its own column.

Parameters:
  • rate (float) – The expected share of missing values in each column that can go missing, in (0, 1); in (0.01, 0.9) for form="quantile".

  • 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.

  • form (str) – How an indicator depends on its own column (see andrey.data.missingness).

Return type:

Mechanism

Raises:

ValueError – If rate or observed is out of range or form is not one of the forms.

Examples

>>> from andrey.data.missingness import self_masking
>>> self_masking(0.2).name
'self_masking'