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

Before Change


    predictions = np.array(y_pred)
    predictions = np.argsort(predictions, -1)
    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)

After Change



@register_metric("rank_response")
def rank_response(y_true, y_pred):
    num_examples = float(len(y_pred))
    predictions = np.array(y_pred)
    predictions = np.flip(np.argsort(predictions, -1), -1)
    rank_tot = 0
    for el in predictions:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

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: NifTK/NiftyNet
Commit Name: fe65da57a1f4e7a6ec365636a92ccca5cef6e80a
Time: 2017-11-16
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/io/image_sets_partitioner.py
Class Name: ImageSetsPartitioner
Method Name: to_string


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