Repository navigation
Fix target label leakage in trainer features - #135
Merged
Merged
Conversation
Keep Label only as the classification target and explicitly select issue and pull request content features. Add regression coverage for label independence and feature preservation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 00205eb9-13a3-4444-8748-3525c7476389
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused change and regression coverage support approval, with no substantiated unresolved issues; tests were not rerun.
0 open findings
What changed in this PR
Removes target-label leakage from trainer features while preserving the classification target and model-specific inputs. Existing models require retraining.
Changes:
- Extracts pipeline creation and excludes
Labelfrom features. - Adds regression tests for label-independent predictions, content features, and model save/load.
- Integrates the trainer test project into the solution.
| File | Description |
|---|---|
| IssueLabeler/tests/Trainer.Tests/TrainingPipelineTests.cs | Adds feature and prediction regression coverage. |
| IssueLabeler/tests/Trainer.Tests/Trainer.Tests.csproj | Configures the MSTest project. |
| IssueLabeler/src/Trainer/TrainingPipeline.cs | Defines label-free feature selection. |
| IssueLabeler/src/Trainer/Trainer.csproj | Exposes internals to trainer tests. |
| IssueLabeler/src/Trainer/Trainer.cs | Uses the extracted pipeline. |
| IssueLabeler/IssueLabeler.sln | Registers trainer tests. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Remove the pipeline extraction and new test project as requested, keeping only the direct exclusion of Label from text features. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 00205eb9-13a3-4444-8748-3525c7476389
Select only title and body for issues, plus file and folder names for pull requests, rather than excluding the target column by name. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 00205eb9-13a3-4444-8748-3525c7476389
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.
Summary
Labelfrom text features while retainingLabelKeyas the classification target.Existing cached models must be retrained to pick up this fix.