Skip to content

[WIP] DOC Explain missing value mechanisms - #23746

Draft
aperezlebel wants to merge 1 commit into
scikit-learn:mainfrom
aperezlebel:mv_mechanisms
Draft

aperezlebel wants to merge 1 commit into
scikit-learn:mainfrom
aperezlebel:mv_mechanisms

Conversation

@aperezlebel

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Addresses task 3 of #21967.

What does this implement/fix? Explain your changes.

Add a section to the "Imputation of missing values" doc to explain the missing value mechanisms.

Any other comments?

Work in progress

@aperezlebel aperezlebel changed the title [WIP] DOC Add draft of missing value mechanisms section [WIP] DOC Explain missing value mechanisms Jun 23, 2022

@glemaitre glemaitre left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is already looking good.

In addition to the synthetic illustration that is good, I am wondering if we could illustrate with a specific application setting related to data collection such that we have formal and applicative aspects.

Comment thread doc/modules/impute.rst

Missing value mechanisms
========================
Three mechanisms model data missingness.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Three mechanisms model data missingness.
Three mechanisms model data missingness exist:

Comment thread doc/modules/impute.rst
========================
Three mechanisms model data missingness.

* **Missing Completely At Random (MCAR)**: the missingness does not depend on data.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about giving a concrete example for each mechanism to illustrate it.

Comment thread doc/modules/impute.rst
:align: center
:scale: 20%

In the above example, X1 is always observed. In the first plot, X2 is masked

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In the above example, X1 is always observed. In the first plot, X2 is masked
In the above example, X1 is always observed. In the left-hand side plot, X2 is masked

Comment thread doc/modules/impute.rst
:scale: 20%

In the above example, X1 is always observed. In the first plot, X2 is masked
independently of the values of (X1, X2), hence MCAR. In the second, X2 is

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
independently of the values of (X1, X2), hence MCAR. In the second, X2 is
independently of the values of (X1, X2), hence MCAR. In the middle, X2 is

Comment thread doc/modules/impute.rst

In the above example, X1 is always observed. In the first plot, X2 is masked
independently of the values of (X1, X2), hence MCAR. In the second, X2 is
masked when X1 (observed) reaches some threshold, hence MAR. In the last, X2 is

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
masked when X1 (observed) reaches some threshold, hence MAR. In the last, X2 is
masked when X1 (observed) reaches some threshold, hence MAR. In the right-hand side plot, X2 is

@glemaitre
glemaitre self-requested a review November 8, 2022 14:46
@glemaitre
glemaitre removed their request for review January 10, 2023 17:25
@glemaitre

Copy link
Copy Markdown
Member

@aperezlebel do you want to address the comment and solve the conflict such that we merge this PR?

Comment thread doc/modules/impute.rst

* **Missing Completely At Random (MCAR)**: the missingness does not depend on data.
* **Missing At Random (MAR)**: the missingness does not depend on underlying
missing values but can depend on observed ones.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Including the target variable y?

Comment thread doc/modules/impute.rst

Missing value mechanisms
========================
Three mechanisms model data missingness.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Three mechanisms model data missingness.
The machine learning literature typically distinguishes between the following
settings. Note that the names are not necessarily very intuitive:

Comment thread doc/modules/impute.rst
* **Missing At Random (MAR)**: the missingness does not depend on underlying
missing values but can depend on observed ones.
* **Missing Not At Random (MNAR)**: the missingness depends on underlying missing
values.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
values.
values. Therefore, the missingness pattern can be statistically associated
with `y` in a supervised classification or regression setting.

@StefanieSenger

Copy link
Copy Markdown
Member

This stalled PR is a good candidate (well defined, scoped task) to be taken over by one of the participants of the sprint at EuroPython/EuroScipy.

@aniket25042005

Copy link
Copy Markdown

I'd like to take over this stalled draft, following @StefanieSenger's suggestion that it be picked up. I've rebased the content on main, resolved the
▎ conflicts, and addressed the review comments from @glemaitre and @ogrisel: each mechanism now has a concrete example, the wording has been tightened,
▎ and the MNAR discussion covers the target y and the need for a missingness indicator. I'll open a follow-up PR and credit @aperezlebel for the original
▎ draft and figure.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants