nikrao commented on issue #7390: adding ranking metrics (precision/recall) at 
position K. 
URL: https://github.com/apache/incubator-mxnet/pull/7390#issuecomment-326130469
 
 
   yes. tested that.
   
   On Wed, Aug 30, 2017 at 2:53 PM, Haibin Lin <notificati...@github.com>
   wrote:
   
   > *@eric-haibin-lin* commented on this pull request.
   > ------------------------------
   >
   > In python/mxnet/metric.py
   > <https://github.com/apache/incubator-mxnet/pull/7390#discussion_r136199686>
   > :
   >
   > > +        Parameters
   > +        ----------
   > +        labels : list of `NDArray`
   > +            The labels of the data. (binary)
   > +        preds : list of `NDArray`
   > +            Predicted values. (float)
   > +
   > +        Returns:
   > +        --------
   > +        The precision at K (float)
   > +        """
   > +        check_label_shapes(labels, preds)
   > +
   > +        for label, pred_label in zip(labels, preds):
   > +            assert(len(pred_label.shape) <= 2), 'Predictions should be no 
more than 2 dims'
   > +            pred_label = 
numpy.argsort(-pred_label.asnumpy().astype('float32'), axis=1)
   >
   > does this work when len(pred_label.shape) == 1 ??
   >
   > ?
   > You are receiving this because you authored the thread.
   > Reply to this email directly, view it on GitHub
   > 
<https://github.com/apache/incubator-mxnet/pull/7390#pullrequestreview-59705826>,
   > or mute the thread
   > 
<https://github.com/notifications/unsubscribe-auth/ASlOLEaFd-kAj9zF1nkswtLk6QJjz5umks5sddncgaJpZM4OxWiq>
   > .
   >
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to