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

Adds correct/incorrect rows to summary card for classification/non-binary evaluations #5388

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

manivoxel51
Copy link
Contributor

@manivoxel51 manivoxel51 commented Jan 14, 2025

What changes are proposed in this pull request?

https://voxel51.atlassian.net/browse/FOEPD-254

for classification and non-binary evaluation, adds Correct/Incorrect rows in summary card
clicking on icon in row would filter the view based on correct/incorrect

video
https://github.com/voxel51/fiftyone-teams/pull/1174

One note potentially outside of the scope of this ticket is that for all the existing, evaluations, there will be correct / incorrect rows in summary card but they will be missing the values because they were never saved when evaluation was calculated.

Note: the correct/incorrect icons are still clickable and work correctly

Screen Shot 2025-01-14 at 2 53 01 PM

How is this patch tested? If it is not, please explain why.

(Details)

Release Notes

Is this a user-facing change that should be mentioned in the release notes?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release
    notes for FiftyOne users.

(Details in 1-2 sentences. You can just refer to another PR with a description
if this PR is part of a larger change.)

What areas of FiftyOne does this PR affect?

  • App: FiftyOne application changes
  • Build: Build and test infrastructure changes
  • Core: Core fiftyone Python library changes
  • Documentation: FiftyOne documentation changes
  • Other

Summary by CodeRabbit

  • New Features

    • Enhanced model evaluation metrics for non-binary classification tasks
    • Added "Correct" and "Incorrect" prediction counts to evaluation view
  • Improvements

    • Expanded performance analysis capabilities for machine learning models
    • Introduced more detailed metrics for classification evaluations

Copy link
Contributor

coderabbitai bot commented Jan 14, 2025

Walkthrough

The pull request introduces enhancements to model evaluation metrics, specifically for non-binary classification tasks. In the frontend (Evaluation.tsx), a new boolean variable isNoneBinaryClassification is added to determine the evaluation type. Two new summary rows for "Correct" and "Incorrect" predictions are introduced, utilizing num_correct and num_incorrect metrics. In the backend (__init__.py), a new method get_correct_incorrect is implemented in the EvaluationPanel class to calculate correct and incorrect predictions for classification evaluations.

Changes

File Change Summary
app/packages/core/src/plugins/SchemaIO/components/NativeModelEvaluationView/Evaluation.tsx - Added isNoneBinaryClassification boolean variable
- Added summary rows for "Correct" and "Incorrect" predictions
plugins/panels/model_evaluation/__init__.py - Added get_correct_incorrect method to EvaluationPanel class
- Modified load_evaluation to include correct/incorrect prediction metrics

Possibly related PRs

Suggested Labels

enhancement

Suggested Reviewers

  • imanjra
  • Br2850

Poem

🐰 Metrics dance, numbers twirl,
Correct and wrong in code unfurl,
Classification's subtle art,
Where insights and logic start,
A rabbit's code, precise and bright! 🔍

Finishing Touches

  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
app/packages/core/src/plugins/SchemaIO/components/NativeModelEvaluationView/Evaluation.tsx (1)

470-487: Consider setting lesserIsBetter to true for incorrect counts.

While the implementation is good, the incorrect count should ideally be minimized. Consider this change:

     {
       id: false,
       property: "Incorrect",
       value: evaluationMetrics.num_incorrect,
       compareValue: compareEvaluationMetrics.num_incorrect,
-      lesserIsBetter: false,
+      lesserIsBetter: true,
       filterable: true,
       hide: !isNoneBinaryClassification,
     },
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a42cd44 and c0fd4b7.

📒 Files selected for processing (2)
  • app/packages/core/src/plugins/SchemaIO/components/NativeModelEvaluationView/Evaluation.tsx (2 hunks)
  • plugins/panels/model_evaluation/__init__.py (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
app/packages/core/src/plugins/SchemaIO/components/NativeModelEvaluationView/Evaluation.tsx (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

🔇 Additional comments (3)
plugins/panels/model_evaluation/__init__.py (2)

328-332: Well-implemented counting logic!

The implementation efficiently uses numpy's vectorized operations to count correct and incorrect predictions, which is optimal for performance.


371-379: Clean integration of correct/incorrect metrics!

The conditional logic appropriately handles non-binary classification cases, and the integration with the existing metrics dictionary is well-structured.

app/packages/core/src/plugins/SchemaIO/components/NativeModelEvaluationView/Evaluation.tsx (1)

213-214: Good flag implementation!

The boolean flag is well-named and correctly implements the condition for non-binary classification evaluations.

Copy link
Contributor

@imanjra imanjra left a comment

Choose a reason for hiding this comment

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

LGTM

@manivoxel51 manivoxel51 merged commit cd326e0 into develop Jan 17, 2025
14 checks passed
@manivoxel51 manivoxel51 deleted the feat/model-eval-correct branch January 17, 2025 20:19
@coderabbitai coderabbitai bot mentioned this pull request Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants