Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align Matching to WeightEstimator interface #53

Merged
merged 6 commits into from
Feb 16, 2023
Merged

Conversation

ehudkr
Copy link
Collaborator

@ehudkr ehudkr commented Feb 15, 2023

Matching can be naturally presented as a weight model (in the most basic scenario, weighting samples as zero and ones for whether they were matched or excluded).
Current implementation of Matching also supports this with the matching_to_weights() function.
However, the API did not align with WeightEstimator's compute_weights(X, a) interface.

This PR fixes it and realigns Matching to WeightEstimator.
This allows Matching to be evaluated using evaluate (for example, plot_covariate_balance()) and allows it to be plugged into other models using weight-models such as WeightedSurvival (which can now generate, for example, matched Kaplan-Meier curves).

This PR also includes an adjustment to the evaluation module to allow Matching to be used - moving the treatment label prediction (used for classification metrics) from the WeightPredictions to PropensityPredictions

Will allow Matching to be used as weight_model in `WeightedSurvival`,
and allow integration with the `evaluation` suite.

include tests.

Signed-off-by: Ehud-Karavani <ehud.karavani@ibm.com>
Signed-off-by: Ehud-Karavani <ehud.karavani@ibm.com>
Signed-off-by: Ehud-Karavani <ehud.karavani@ibm.com>
Predicting the treatment label is only defined when you have a
propensity model, not a general weighting model.

Treatment label prediction is used for some of the `evaluation` metrics,
but those metrics are not well-defined for weight models.

Since the weight models can only be evaluated on their covariate balance
(currently), then it no longer need to use the compounded Result object
`WeightEvaluatorScores` and can return a covariate-balancing DataFrame
(similar to how `OutcomePredictions` only returns a DataFrame with the
scores).

Signed-off-by: Ehud-Karavani <ehud.karavani@ibm.com>
Now that the compounded evaluation (prediction metrics and covariate
balancing) is only used by the `PropensityPredictions` (and not
`WeightPredictions`), the object obtaining those scores should reflect
it's only relevant for propensity (treatment-prediction) models.
Otherwise, it might cause confusion.

Signed-off-by: Ehud-Karavani <ehud.karavani@ibm.com>
Signed-off-by: Ehud-Karavani <ehud.karavani@ibm.com>
@ehudkr ehudkr merged commit 82aea15 into master Feb 16, 2023
@ehudkr ehudkr deleted the matching-weightestimator branch February 16, 2023 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant