Align model_matrix input errors and docs#352
Closed
neuralsorcerer wants to merge 10 commits intofacebookresearch:mainfrom
Closed
Align model_matrix input errors and docs#352neuralsorcerer wants to merge 10 commits intofacebookresearch:mainfrom
model_matrix input errors and docs#352neuralsorcerer wants to merge 10 commits intofacebookresearch:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates documentation to better explain how model-matrix inputs are prepared, and records the doc clarification in the changelog.
Changes:
- Expanded
_prepare_input_model_matrixdocstring argument descriptions (sample,target,variables,add_na,fix_columns_names). - Added a changelog entry under Documentation noting the clarification.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
balance/utils/model_matrix.py |
Clarifies _prepare_input_model_matrix argument behavior in the docstring. |
CHANGELOG.md |
Notes the docstring clarification under the Documentation section. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
tests/test_util_model_matrix.py:299
- This test uses
pd.DataFrame()(zero rows and zero columns). Since the intent is specifically “zero rows”, consider constructing an empty frame with representative columns (e.g.,pd.DataFrame(columns=[...])) so the assertion is unambiguous and continues to validate the intended contract if column-handling changes.
# Test zero rows error:
self.assertRaisesRegex(
ValueError,
"sample must have more than zero rows",
model_matrix,
pd.DataFrame(),
)
model_matrix input errors and docs
talgalili
approved these changes
Mar 1, 2026
Contributor
talgalili
left a comment
There was a problem hiding this comment.
LGTM.
Might take a day to land.
|
@talgalili has imported this pull request. If you are a Meta employee, you can view this in D94872326. |
|
@talgalili merged this pull request in 93c62b6. |
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.
No description provided.