Skip to content

Change efficiency to be maximimal for a point prediction and minimal …#88

Merged
timoverse merged 1 commit intomainfrom
efficiency-metric
Apr 29, 2025
Merged

Change efficiency to be maximimal for a point prediction and minimal …#88
timoverse merged 1 commit intomainfrom
efficiency-metric

Conversation

@pwhofman
Copy link
Copy Markdown
Owner

…when covering the whole simplex

@pwhofman pwhofman requested review from Copilot and timoverse April 29, 2025 11:40
@pwhofman pwhofman self-assigned this Apr 29, 2025
@pwhofman pwhofman added this to probly Apr 29, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modifies the efficiency metrics to invert their values so that point predictions are deemed maximal and simplex coverage is minimal.

  • Inverts the computation in efficiency for 2D and 3D arrays
  • Adjusts covered_efficiency calculation by applying (1 - mean) instead of a direct mean

Comment thread src/probly/metrics.py
if preds.ndim == 2:
covered = preds[np.arange(preds.shape[0]), targets]
ceff = np.mean(preds[covered])
ceff = 1 - np.mean(preds[covered])
Copy link

Copilot AI Apr 29, 2025

Choose a reason for hiding this comment

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

In the 2D branch of covered_efficiency, 'covered' already holds the selected values from preds. Using preds[covered] may lead to unexpected behavior; consider replacing it with np.mean(covered).

Suggested change
ceff = 1 - np.mean(preds[covered])
ceff = 1 - np.mean(covered)

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

@timoverse timoverse left a comment

Choose a reason for hiding this comment

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

Well done!

@github-project-automation github-project-automation Bot moved this to Done in probly Apr 29, 2025
@timoverse timoverse merged commit 5bf3a1b into main Apr 29, 2025
7 checks passed
@timoverse timoverse deleted the efficiency-metric branch April 29, 2025 11:58
elias0224 pushed a commit to elias0224/probly that referenced this pull request Oct 30, 2025
davyddzhalaiansamani pushed a commit to D4V1ND/probly that referenced this pull request Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants