예제 #1
0
파일: LSH.cs 프로젝트: nguyenkiet/Waiter
    public Dictionary <int, double> closestSimilarItems(int setIndex, MinHash <T> minHasher)
    {
        Dictionary <int, double> closestMap = new Dictionary <int, double>();

        HashSet <int> closeMembers = getCloseMembers(setIndex, minHasher);

        foreach (int intIndex in closeMembers)
        {
            if (intIndex != setIndex)
            {
                double similarity = minHasher.ComputeSimilarity(minHashValues, setIndex, intIndex);
                closestMap.Add(intIndex, similarity);
            }
        }
        return(closestMap);
    }