c672738b39c8f739551da0d88991a2fedfba3e14,deeppavlov/models/ranking/metrics.py,,rank_response,#Any#Any#,37

Before Change


    ranks = []
    for i in range(predictions.shape[0]):
        for j in range(predictions.shape[1]):
            if predictions[i][j] in np.arange(labels[i][j]):
                ranks.append(j)
                break
    return np.mean(np.asarray(ranks).astype(float))


@register_metric("loss")

After Change


            if x == 0:
                rank_tot += i
                break
    return float(rank_tot)/num_examples

@register_metric("r@1_insQA")
def r_at_1_insQA(y_true, y_pred):
    return recall_at_k_insQA(y_true, y_pred, k=1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: deepmipt/DeepPavlov
Commit Name: c672738b39c8f739551da0d88991a2fedfba3e14
Time: 2018-10-04
Author: puleon@mail.ru
File Name: deeppavlov/models/ranking/metrics.py
Class Name:
Method Name: rank_response


Project Name: deepmipt/DeepPavlov
Commit Name: c672738b39c8f739551da0d88991a2fedfba3e14
Time: 2018-10-04
Author: puleon@mail.ru
File Name: deeppavlov/models/ranking/metrics.py
Class Name:
Method Name: recall_at_k


Project Name: ray-project/ray
Commit Name: bff50cfc37380140d53debfb140e262a38668db0
Time: 2020-12-18
Author: 62982571+Gekho457@users.noreply.github.com
File Name: python/ray/autoscaler/_private/kubernetes/config.py
Class Name:
Method Name: _get_resource