Skip to content

Fix target label leakage in trainer features - #135

Merged
jeffhandley merged 3 commits into
mainfrom
matouskozak-trainer-label-leakage
Oct 19, 2026
Merged

jeffhandley merged 3 commits into
mainfrom
matouskozak-trainer-label-leakage

Conversation

@matouskozak

@matouskozak matouskozak commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Exclude Label from text features while retaining LabelKey as the classification target.
  • Preserve title/body features for issues and file/folder features for pull requests.

Existing cached models must be retrained to pick up this fix.

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
Copilot AI balanced review requested due to automatic review settings October 16, 2026 10:22
@github-actions github-actions Bot added the area-Predictor Related to label prediction behavior and label application label Oct 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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 Label from 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
Copilot AI balanced review requested due to automatic review settings October 16, 2026 10:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused change removes label leakage while preserving the target and intended features.

0 open findings

🧠 Review effort: Balanced

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
Copilot AI balanced review requested due to automatic review settings October 16, 2026 10:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused change removes label leakage while preserving intended inputs, with no blocking issues identified.

0 open findings

🧠 Review effort: Balanced

@matouskozak matouskozak self-assigned this Oct 16, 2026
@matouskozak
matouskozak marked this pull request as ready for review October 19, 2026 07:01

@jeffhandley jeffhandley 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.

Great catch!

@jeffhandley
jeffhandley merged commit 73c2d0a into main Oct 19, 2026
3 checks passed
@jeffhandley
jeffhandley deleted the matouskozak-trainer-label-leakage branch October 19, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Predictor Related to label prediction behavior and label application

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants