interpret_community.common.metrics module¶
Defines metrics for validating model explanations.
-
interpret_community.common.metrics.
dcg
(validate_order, ground_truth_order_relevance, top_values=10)¶ Compute the discounted cumulative gain (DCG).
Compute the DCG as the sum of relevance scores penalized by the logarithmic position of the result. See https://en.wikipedia.org/wiki/Discounted_cumulative_gain for reference.
Parameters:
-
interpret_community.common.metrics.
ndcg
(validate_order, ground_truth_order, top_values=10)¶ Compute the normalized discounted cumulative gain (NDCG).
Compute the NDCG as the ratio of the DCG for the validation order compared to the maximum DCG possible for the ground truth order. If the validation order is the same as the ground truth the NDCG will be the maximum of 1.0, and the least possible NDCG is 0.0. See https://en.wikipedia.org/wiki/Discounted_cumulative_gain for reference.
Parameters: