Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/AmenRa/ranx
/ functions
Functions
578 in github.com/AmenRa/ranx
⨍
Functions
578
◇
Types & classes
5
↓ 97 callers
Method
keys
Returns query ids. Used internally.
ranx/data_structures/run.py:77
↓ 48 callers
Function
evaluate
Compute the performance scores for the provided `qrels` and `run` for all the specified metrics. Usage examples: from ranx import evaluate
ranx/meta/evaluate.py:65
↓ 26 callers
Function
create_empty_results_dict
()
ranx/fusion/common.py:19
↓ 26 callers
Method
to_typed_list
Convert Run to Numba Typed List. Used internally.
ranx/data_structures/run.py:161
↓ 26 callers
Function
to_unicode
Forces type conversion to numba.types.unicode_type.
ranx/fusion/common.py:13
↓ 25 callers
Function
convert_results_dict_list_to_run
(q_ids, results_dict_list)
ranx/fusion/common.py:32
↓ 25 callers
Function
create_empty_results_dict_list
(length)
ranx/fusion/common.py:27
↓ 21 callers
Method
add_score
Add a (doc_id, score) pair to a query (or, change its value if it already exists). Args: q_id (str): Query ID doc_id
ranx/data_structures/run.py:81
↓ 21 callers
Method
add_score
Add a (doc_id, score) pair to a query (or, change its value if it already exists). Args: q_id (str): Query ID doc_id
ranx/data_structures/qrels.py:93
↓ 19 callers
Method
sort
Sort. Used internally.
ranx/data_structures/run.py:136
↓ 14 callers
Method
from_dict
Convert a Python dictionary in form of {q_id: {doc_id: score}} to ranx.Run. Args: d (Dict[str, Dict[str, int]]): Run as Python di
ranx/data_structures/run.py:228
↓ 12 callers
Method
keys
Returns query ids. Used internally.
ranx/data_structures/qrels.py:89
↓ 11 callers
Function
clean_qrels
(qrels, rel_lvl)
ranx/metrics/common.py:6
↓ 10 callers
Function
comb_sum
r"""Computes CombSUM as proposed by [Fox et al.](https://trec.nist.gov/pubs/trec2/papers/txt/23.txt). ```bibtex @inproceedings{DBLP:conf/
ranx/fusion/comb_sum.py:44
↓ 9 callers
Function
get_file_kind
(path: str = "run.json", kind: str = None)
ranx/data_structures/run.py:398
↓ 9 callers
Method
get_stat_test_label
(self, stat_test: str)
ranx/data_structures/report.py:127
↓ 8 callers
Function
fix_k
(k, run)
ranx/metrics/common.py:11
↓ 8 callers
Function
get_file_kind
(path: str = "qrels.json", kind: str = None)
ranx/data_structures/qrels.py:370
↓ 8 callers
Method
to_dict
Convert Run to Python dictionary. Returns: Dict[str, Dict[str, int]]: Run as Python dictionary
ranx/data_structures/run.py:167
↓ 7 callers
Function
compare
Evaluate multiple `runs` and compute statistical tests. Usage example: ```python from ranx import compare # Compare different runs a
ranx/meta/compare.py:11
↓ 7 callers
Function
create_empty_results_dict
()
ranx/normalization/common.py:14
↓ 7 callers
Method
from_file
Parse a run file into ranx.Run. Supported formats are JSON, TREC run, gzipped TREC run, and LZ4. Correct import behavior is inferred from the file ext
ranx/data_structures/run.py:261
↓ 6 callers
Method
add_multi
Add multiple queries at once. Args: q_ids (List[str]): List of Query IDs doc_ids (List[List[str]]): List of list of D
ranx/data_structures/run.py:107
↓ 6 callers
Method
add_multi
Add multiple queries at once. Args: q_ids (List[str]): List of Query IDs doc_ids (List[List[str]]): List of list of D
ranx/data_structures/qrels.py:119
↓ 6 callers
Function
convert_results_dict_list_to_run
(q_ids, results_dict_list)
ranx/normalization/common.py:27
↓ 6 callers
Function
create_empty_results_dict_list
(length)
ranx/normalization/common.py:22
↓ 6 callers
Function
get_hit_lists
Compute the hit lists (at k). **Hit list** is a binary list whose element in position p is 1 if the document retrieved in position p is relevant,
ranx/metrics/get_hit_lists.py:47
↓ 6 callers
Function
norm_switch
(method: str = "min-max")
ranx/normalization/__init__.py:18
↓ 5 callers
Method
from_df
Convert a Pandas DataFrame to ranx.Run. Args: df (pd.DataFrame): Run as Pandas DataFrame q_id_col (str, optional): Qu
ranx/data_structures/run.py:294
↓ 5 callers
Function
optimize_weights
( fusion_method: Callable, qrels: Qrels, runs: List[Run], metric: str, step: float = 0.1,
ranx/fusion_optimization/optimize_weights.py:20
↓ 5 callers
Function
to_unicode
Forces type conversion to numba.types.unicode_type.
ranx/normalization/common.py:8
↓ 4 callers
Function
_hits
(qrels, run, k, rel_lvl)
ranx/metrics/hits.py:12
↓ 4 callers
Function
create_and_sort
(q_ids, doc_ids, scores)
ranx/data_structures/common.py:131
↓ 4 callers
Function
extract_scores
Extract the scores from a given results dictionary.
ranx/normalization/common.py:37
↓ 4 callers
Method
from_dict
Convert a Python dictionary in form of {q_id: {doc_id: score}} to ranx.Qrels. Args: d (Dict[str, Dict[str, int]]): Qrels as Pytho
ranx/data_structures/qrels.py:221
↓ 4 callers
Function
rbc
r"""Computes Rank-Biased Centroid (RBC) as proposed by [Bailey et al.](https://dl.acm.org/doi/10.1145/3077136.3080839). ```bibtex @inproceedi
ranx/fusion/rbc.py:38
↓ 4 callers
Function
slidefuse_train
(qrels: Qrels, runs: List[Run])
ranx/fusion/slidefuse.py:98
↓ 4 callers
Function
sort_dict_by_key
(d)
ranx/data_structures/common.py:63
↓ 4 callers
Function
sort_dict_of_dict_by_value
(d)
ranx/data_structures/common.py:89
↓ 4 callers
Method
to_dataframe
Convert Run to Pandas DataFrame with the following columns: `q_id`, `doc_id`, and `score`. Returns: pandas.DataFrame: Run as Pand
ranx/data_structures/run.py:178
↓ 4 callers
Method
to_latex
Returns Report as LaTeX table. Returns: str: LaTeX table
ranx/data_structures/report.py:181
↓ 3 callers
Function
_dcg
(qrels, run, k, rel_lvl, jarvelin)
ranx/metrics/ndcg.py:12
↓ 3 callers
Function
_estimate_log_odds
(hit_lists, cut_offs)
ranx/fusion/bayesfuse.py:56
↓ 3 callers
Function
_isr_score_parallel
(run)
ranx/fusion/isr.py:28
↓ 3 callers
Function
comb_gmnz
r"""Computes CombGMNZ as proposed by [Joon Ho Lee](https://dl.acm.org/doi/10.1145/258525.258587). ```bibtex @inproceedings{DBLP:conf/sigi
ranx/fusion/comb_gmnz.py:44
↓ 3 callers
Function
comb_mnz
r"""Computes CombMNZ as proposed by [Fox et al.](https://trec.nist.gov/pubs/trec2/papers/txt/23.txt).<br /> ```bibtex @inproceedings{DBLP
ranx/fusion/comb_mnz.py:44
↓ 3 callers
Function
create_dict_from_lists
(keys, values)
ranx/data_structures/common.py:47
↓ 3 callers
Function
get_candidates
(runs)
ranx/fusion/bordafuse.py:17
↓ 3 callers
Function
get_results
(runs)
ranx/fusion/condorcet.py:35
↓ 3 callers
Function
min_max_norm
Apply `min_max norm` to a given run. Args: run (Run): Run to be normalized. Returns: Run: Normalized run.
ranx/normalization/min_max_norm.py:50
↓ 3 callers
Function
posfuse_train
(qrels: Qrels, runs: List[Run])
ranx/fusion/posfuse.py:88
↓ 3 callers
Function
rank_biased_precision
r"""Compute Rank-biased Precision (RBP). It is defined as: $$ \operatorname{RBP} = (1 - p) \cdot \sum_{i=1}^{d}{r_i \cdot p^{i - 1}}
ranx/metrics/rank_biased_precision.py:47
↓ 3 callers
Method
save
Write `run` to `path` as JSON file, TREC run, LZ4 file, or Parquet file. File type is automatically inferred form the filename extension: ".json" -> "
ranx/data_structures/run.py:194
↓ 3 callers
Function
segfuse_train
(qrels: Qrels, runs: List[Run])
ranx/fusion/segfuse.py:119
↓ 3 callers
Function
slidefuse
r"""Computes SlideFuse as proposed by [Lillis et al.](https://link.springer.com/chapter/10.1007/978-3-540-78646-7_33). ```bibtex @inproceedin
ranx/fusion/slidefuse.py:43
↓ 2 callers
Function
_borda_score_parallel
(run, candidates)
ranx/fusion/bordafuse.py:51
↓ 2 callers
Function
_dcg_parallel
(qrels, run, k, rel_lvl, jarvelin)
ranx/metrics/ndcg.py:44
↓ 2 callers
Function
_get_hit_list
(qrels, run, k, rel_lvl)
ranx/metrics/get_hit_lists.py:13
↓ 2 callers
Function
_get_run_indices
(results, candidates)
ranx/fusion/condorcet.py:47
↓ 2 callers
Function
_get_unjudged_list
(qrels, run, k)
ranx/metrics/get_unjudged_lists.py:12
↓ 2 callers
Function
_ndcg_parallel
(qrels, run, k, rel_lvl, jarvelin)
ranx/metrics/ndcg.py:69
↓ 2 callers
Function
_precision
(qrels, run, k, rel_lvl)
ranx/metrics/precision.py:12
↓ 2 callers
Function
add_and_sort
(d, q_ids, doc_ids, scores)
ranx/data_structures/common.py:108
↓ 2 callers
Function
bayesfuse_train
(qrels: Qrels, runs: List[Run])
ranx/fusion/bayesfuse.py:162
↓ 2 callers
Function
bordafuse
r"""Computes BordaFuse as proposed by [Aslam et al.](https://dl.acm.org/doi/10.1145/383952.384007). ```bibtex @inproceedings{DBLP:conf/sigir/
ranx/fusion/bordafuse.py:61
↓ 2 callers
Function
condorcet
r"""Computes CondorcetFuse as proposed by [Montague et al.](https://dl.acm.org/doi/10.1145/584792.584881). ```bibtex @inproceedings{DBLP:conf
ranx/fusion/condorcet.py:97
↓ 2 callers
Function
create_empty_results_dict
()
ranx/data_structures/generic.py:7
↓ 2 callers
Function
downloader
(url: str, path: str, file_size: int, resume_byte_pos: int = None)
ranx/downloader.py:12
↓ 2 callers
Function
estimate_probfuse_probs
(qrels: Qrels, runs: List[Run], n_segments: int)
ranx/fusion/probfuse.py:51
↓ 2 callers
Function
estimate_probs_multi
(qrels: Qrels, runs: List[Run])
ranx/fusion/common.py:61
↓ 2 callers
Function
f1
r"""Compute F1 (at k). **F1** is the harmonic mean of [**Precision**][ranx.metrics.precision] and [**Recall**][ranx.metrics.recall].<br /> If
ranx/metrics/f1.py:41
↓ 2 callers
Function
format_metrics
(metrics: Union[List[str], str])
ranx/meta/evaluate.py:13
↓ 2 callers
Method
format_score
(self, score)
ranx/data_structures/report.py:92
↓ 2 callers
Method
from_parquet
Convert a Parquet file to ranx.Run. Args: path (str): File path. q_id_col (str, optional): Query IDs column. Defaults
ranx/data_structures/run.py:332
↓ 2 callers
Function
get_candidates
(runs)
ranx/fusion/condorcet.py:18
↓ 2 callers
Method
get_metric_label
(self, m)
ranx/data_structures/report.py:109
↓ 2 callers
Function
load_lz4
(path: str)
ranx/io.py:64
↓ 2 callers
Function
logn_isr
r"""Computes Log_ISR as proposed by [Mourão et al.](https://www.sciencedirect.com/science/article/abs/pii/S0895611114000664).<br /> ```bibtex
ranx/fusion/logn_isr.py:45
↓ 2 callers
Method
make_comparable
Adds empty results for queries missing from the run and removes those not appearing in qrels.
ranx/data_structures/run.py:142
↓ 2 callers
Function
mapfuse_train
(qrels: Qrels, runs: List[Run])
ranx/fusion/mapfuse.py:89
↓ 2 callers
Function
mixed
r"""Computes Mixed as proposed by [Wu et al.](https://dl.acm.org/doi/10.1145/584792.584908). ```bibtex @inproceedings{DBLP:conf/cikm/WuC0
ranx/fusion/mixed.py:51
↓ 2 callers
Function
optimization_switch
(method: str)
ranx/fusion_optimization/__init__.py:55
↓ 2 callers
Function
precision
r"""Compute Precision (at k). **Precision** is the proportion of the retrieved documents that are relevant.<br /> If k > 0, only the top-k re
ranx/metrics/precision.py:29
↓ 2 callers
Function
probfuse
r"""Computes ProbFuse as proposed by [Lillis et al.](https://dl.acm.org/doi/10.1145/1148170.1148197). ```bibtex @inproceedings{DBLP:conf/sigi
ranx/fusion/probfuse.py:89
↓ 2 callers
Function
probfuse_train
(qrels: Qrels, runs: List[Run], n_segments: int)
ranx/fusion/probfuse.py:135
↓ 2 callers
Function
python_dict_to_typed_list
Converts a nested Python Dictionary to Numba Typed List to be used with ranx's metrics with no effort. Note: Doc IDs will be hashed.
ranx/utils.py:24
↓ 2 callers
Function
recall
r"""Compute Recall (at k). **Recall** is the ratio between the retrieved documents that are relevant and the total number of relevant documents.<
ranx/metrics/recall.py:34
↓ 2 callers
Function
rrf
r"""Computes Reciprocal Rank Fusion as proposed by [Cormack et al.](https://dl.acm.org/doi/10.1145/1571941.1572114). ```bibtex @inproceed
ranx/fusion/rrf.py:39
↓ 2 callers
Function
safe_max
(x)
ranx/normalization/common.py:46
↓ 2 callers
Function
safe_min
(x)
ranx/normalization/common.py:53
↓ 2 callers
Function
save_lz4
(content: dict, path: str)
ranx/io.py:57
↓ 2 callers
Method
sort
Sort. Used internally.
ranx/data_structures/qrels.py:152
↓ 2 callers
Method
style_best
(self, x)
ranx/data_structures/optimization_report.py:82
↓ 2 callers
Method
to_dict
Convert Qrels to Python dictionary. Returns: Dict[str, Dict[str, int]]: Qrels as Python dictionary
ranx/data_structures/qrels.py:164
↓ 2 callers
Method
to_dict
Returns the Report data as a Python dictionary. ``` { "stat_test": "fisher" # metrics and model_names allows
ranx/data_structures/report.py:253
↓ 2 callers
Method
to_table
(self)
ranx/data_structures/report.py:130
↓ 2 callers
Method
to_table
(self)
ranx/data_structures/optimization_report.py:85
↓ 2 callers
Function
to_typed_list
(d)
ranx/data_structures/common.py:8
↓ 2 callers
Function
weighted_bordafuse
r"""Computes Weighted BordaFuse as proposed by [Aslam et al.](https://dl.acm.org/doi/10.1145/383952.384007). ```bibtex @inproceedings{DBLP:co
ranx/fusion/weighted_bordafuse.py:8
↓ 2 callers
Function
weighted_condorcet
r"""Computes Weighted CondorcetFuse as proposed by [Montague et al.](https://dl.acm.org/doi/10.1145/584792.584881). ```bibtex @inproceedings{
ranx/fusion/weighted_condorcet.py:58
next →
1–100 of 578, ranked by callers