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

Track origin confusion matrix padding fix #267

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

### [Latest]
- Removed padded tracks from consideration when generating track origin classification CM [!267](https://github.com/umami-hep/puma/pull/267)

### [v0.3.5] (2024/04/23)
- Confusion Matrix: added per-class fake rates plus minor appearance changes [!266](https://github.com/umami-hep/puma/pull/266)
Expand Down
5 changes: 5 additions & 0 deletions puma/hlplots/aux_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,11 @@ def plot_track_origin_confmat(
target = tagger.aux_labels["track_origin"].reshape(-1)
predictions = tagger.aux_scores["track_origin"].reshape(-1)

padding_removal = target >= 0

target = target[padding_removal]
predictions = predictions[padding_removal]

# Computing the confusion matrix
cm, eff, fake = confusion_matrix(target, predictions, normalize=normalize)

Expand Down
Loading