c672738b39c8f739551da0d88991a2fedfba3e14,deeppavlov/models/ranking/metrics.py,,recall_at_k,#Any#Any#Any#,24

Before Change


    flags = np.zeros_like(predictions)
    for i in range(predictions.shape[0]):
        for j in range(predictions.shape[1]):
            if predictions[i][j] in np.arange(labels[i][j]):
                flags[i][j] = 1.
    return np.mean((np.sum(flags, -1) >= 1.).astype(float))


@register_metric("rank_response")

After Change


    return recall_at_k(labels, predictions, k=10)

def recall_at_k(y_true, y_pred, k):
    num_examples = float(len(y_pred))
    predictions = np.array(y_pred)
    predictions = np.flip(np.argsort(predictions, -1), -1)[:, :k]
    num_correct = 0
    for el in predictions:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 6

Non-data size: 3

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: recall_at_k


Project Name: DT42/BerryNet
Commit Name: 1a4afd3eb200e41706b67497bdc94261263147ee
Time: 2018-02-19
Author: bofu@dt42.io
File Name: berrynet/engine/movidius.py
Class Name:
Method Name: process_inceptionv3_output


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: 29bb1d395f6caf76b8318a1c72ace753ad98f30c
Time: 2017-12-18
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/layer/upsample_res_block.py
Class Name: UpBlock
Method Name: layer_op


Project Name: chainer/chainercv
Commit Name: 21426b86a47a5e48ac0a6c51e7ca67596fca9cb7
Time: 2017-06-15
Author: SESA5474@WTJPLVSE010002D.apa.gad.schneider-electric.com
File Name: chainercv/utils/download.py
Class Name:
Method Name: _reporthook


Project Name: wkentaro/labelme
Commit Name: b6e0df882cda9f08654318b494fe49ea79a0a939
Time: 2018-02-01
Author: jonas.serych@gmail.com
File Name: labelme/shape.py
Class Name: Shape
Method Name: nearestVertex