Skip to content

Added ranking prior to permutation testing - #10

Merged
sarthakpati merged 9 commits into
mainfrom
fixing_9
Jul 31, 2025
Merged

Added ranking prior to permutation testing#10
sarthakpati merged 9 commits into
mainfrom
fixing_9

Conversation

@sarthakpati

@sarthakpati sarthakpati commented Jul 15, 2025

Copy link
Copy Markdown
Contributor

Fixes #9

Also adds a better default for CLI

@sarthakpati
sarthakpati marked this pull request as draft July 15, 2025 15:14
@sarthakpati
sarthakpati requested a review from Copilot July 15, 2025 15:14

Copilot AI left a comment

Copy link
Copy Markdown

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 fixes issue #9 by adding ranking functionality prior to permutation testing and improves the CLI default value. The changes ensure that data is properly sorted by cumulative rank before performing permutation tests, and provides a better default for the metrics-for-reversal CLI parameter.

  • Sorts ranks_per_metric by cumulative_rank before sanitization in permutation testing
  • Resets the dataframe index after sorting to maintain proper ordering
  • Changes CLI default for metrics-for-reversal from None to empty string

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pyranker/ranker.py Adds sorting by cumulative_rank and index reset before permutation test sanitization
pyranker/cli/run.py Changes default value for metrics-for-reversal parameter from None to empty string
Comments suppressed due to low confidence (1)

pyranker/ranker.py:129

  • [nitpick] The variable name 'ranks_per_metric_sorted' is verbose and inconsistent with the existing naming pattern. Consider renaming to 'sorted_ranks' or 'ranks_sorted' to be more concise and align with the existing 'ranks_per_metric_sanitized' naming pattern.
        ranks_per_metric_sorted = self.ranks_per_metric.sort_values(by="cumulative_rank")

Comment thread pyranker/ranker.py Outdated
sarthakpati and others added 2 commits July 15, 2025 11:15
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sarthakpati

Copy link
Copy Markdown
Contributor Author

Here are the results on the sample data:

method,m1,m2,m3,m4
m1,0.0,0.913,0.906,0.548
m2,0.0,0.0,0.434,0.112
m3,0.0,0.0,0.0,0.112
m4,0.0,0.0,0.0,0.0
method,m1,m2,m3,m4
m1,0.0,0.429,0.091,0.08
m2,0.0,0.0,0.101,0.057
m3,0.0,0.0,0.0,0.384
m4,0.0,0.0,0.0,0.0

@sarthakpati
sarthakpati marked this pull request as ready for review July 31, 2025 20:09
@sarthakpati
sarthakpati merged commit a631cb9 into main Jul 31, 2025
1 of 2 checks passed
@sarthakpati
sarthakpati deleted the fixing_9 branch July 31, 2025 20:16
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.

Perform permutation tests after rankings

2 participants