ranking_metrics.py - cmikke97/Automatic-Malware-Signature-Generation GitHub Wiki

In this page

Imported Modules

  • import numpy as np - the fundamental package for scientific computing with Python - numpy documentation

Back to top

Classes and functions

reciprocal_rank(rs) (function) - Compute reciprocal ranks for a bunch of queries: reciprocal of the rank of the first relevant item for each query (considering the first element being of 'rank 1'). Relevance is binary (nonzero is relevant).

  • rs (arg) - Iterator of relevance scores (list or numpy ndarrays) in rank order (first element is the first item)

mean_reciprocal_rank(rs) (function) - Compute mean reciprocal rank: reciprocal of the rank of the first relevant item (considering the first element being of 'rank 1'). Relevance is binary (nonzero is relevant).

  • rs (arg) - Iterator of relevance scores (list or numpy ndarrays) in rank order (first element is the first item)

max_reciprocal_rank_index(rs) (function) - Compute the index of the query with maximum reciprocal rank: reciprocal of the rank of the first relevant item (considering the first element being of 'rank 1'). Relevance is binary (nonzero is relevant).

  • rs (arg) - Iterator of relevance scores (list or numpy ndarrays) in rank order (first element is the first item)

min_reciprocal_rank_index(rs) (function) - Compute the index of the query with minimum reciprocal rank: reciprocal of the rank of the first relevant item (considering the first element being of 'rank 1'). Relevance is binary (nonzero is relevant).

  • rs (arg) - Iterator of relevance scores (list or numpy ndarrays) in rank order (first element is the first item)

precision_at_k(r, k) (function) - Compute precision up to the k-th prediction. Relevance is binary (nonzero is relevant).

  • r (arg) - Relevance scores (list or numpy) in rank order (first element is the first item)
  • k (arg) - k

average_precision(r) (function) - Compute average precision (area under PR curve). Relevance is binary (nonzero is relevant).

  • r (arg) - Relevance scores (list or numpy) in rank order (first element is the first item)

mean_average_precision(rs) (function) - Compute mean average precision. Relevance is binary (nonzero is relevant).

  • rs (arg) - Iterator of relevance scores (list or numpy) in rank order (first element is the first item)

max_average_precision_index(rs) (function) - Compute the index of the query with minimum average precision. Relevance is binary (nonzero is relevant).

  • rs (arg) - Iterator of relevance scores (list or numpy) in rank order (first element is the first item)

min_average_precision_index(rs) (function) - Compute the index of the query with maximum average precision. Relevance is binary (nonzero is relevant).

  • rs (arg) - Iterator of relevance scores (list or numpy) in rank order (first element is the first item)

Back to top

⚠️ **GitHub.com Fallback** ⚠️