Add WordBasisLinearModel for word-basis explanations of linear classifiers#1024
Open
sawruhv wants to merge 3 commits intosunlabuiuc:masterfrom
Open
Add WordBasisLinearModel for word-basis explanations of linear classifiers#1024sawruhv wants to merge 3 commits intosunlabuiuc:masterfrom
sawruhv wants to merge 3 commits intosunlabuiuc:masterfrom
Conversation
5213ad8 to
e4d3b56
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contributor
Type of Contribution
Original Paper
High-Level Description
This PR adds
WordBasisLinearModel, a PyHealth model inspired by the paper Representing visual classification as a linear combination of words.The model reproduces the paper’s core two-step idea in a minimal PyHealth-friendly form:
This PR focuses on the model contribution only. It does not attempt to reproduce the full paper pipeline, reader study, or dataset-specific preprocessing. Instead, it implements the core word-basis explanation method as a reusable PyHealth model.
The PR also includes:
Ablation / Example
The example script performs a weight decay sweep:
weight_decay = 0.0weight_decay = 1e-4weight_decay = 1e-2It compares:
This is the concrete model ablation required by the rubric.
File Guide
Please review these files:
pyhealth/models/word_basis_linear_model.pypyhealth/models/__init__.pytests/models/test_word_basis_linear_model.pyexamples/sample_binary_word_basis_linear_model.pydocs/api/models/pyhealth.models.word_basis_linear_model.rstdocs/api/models.rstNotes