API reference

andrey.data.missingness.Missingness#

class andrey.data.missingness.Missingness(*, mask, parents, mechanism, form, rate)[source]#

The missing values drawn over a dataset, with the parents of each missingness indicator.

The missingness indicator R_i of column i is 1 where its value is missing. The m-graph adds every indicator to the causal graph, with an edge into it from each of its parents (Mohan, Pearl, and Tian 2013); andrey.data.missingness draws them.

Parameters:
  • mask (ndarray) – True where a value is missing; the data hold NaN there.

  • parents (dict[int, list[int]]) – Each column that can go missing, mapped to the columns its indicator depends on, in ascending order: [] under "mcar", always-observed columns under "mar", other columns that can go missing under "mnar", and [i] for column i under "self_masking". A column it does not list is always observed.

  • mechanism (str) – "mcar", "mar", "mnar", or "self_masking".

  • form (str | None) – How an indicator depends on its parents, "logistic" or "quantile"; None under "mcar".

  • rate (float) – The expected share of missing values in each column that can go missing.

References

Mohan, K., Pearl, J., and Tian, J. (2013). Graphical models for inference with missing data. Advances in Neural Information Processing Systems 26.