How to obtain distance between images from two datasets and get ranks using nearest neighbors?

User 5250 | 5/31/2016, 1:26:16 AM

I have test set and train set and would like to obtain ranks of each training image w.r.t. each test image. I trained all images with AlexNet model and obtained features for all images in both sets. SFrame is combimed for both sets with an extra column called 'label' indicating 1 for train images (reference) and 2 for test images (query). I'm using nn model to get ranks but they are including test images too as reference labels. Please help me out, I couldn't find any thing relevant in documentation.

Comments

User 940 | 6/1/2016, 12:46:49 AM

Hi @"Kanakam Teja Maddala" ,

Could you do something like

` reference = sframe[sframe['label'] == 1] query = sframe[sframe['label'] == 2]

mdl = graphlab.nearest_neighbors.create(reference) `

Let us know if this helps!

Cheers! -Piotr


User 5250 | 6/15/2016, 4:22:20 PM

Thanks @piotr Actually I figured a way around with indexing and looping around two separate SFrames instead of using 'labels' in a single SFrame.


User 940 | 6/20/2016, 6:27:26 PM

@"Kanakam Teja Maddala" ,

I'm glad you figured something out! Let us know if you have any more questions.

Cheers! -Piotr