Did I find the right examples for you? yes no

All Samples(23)  |  Call(18)  |  Derive(0)  |  Import(5)

src/s/t/streaming_lsh-HEAD/streaming_lsh/demo/OfflineLSHClusteringDemo.py   streaming_lsh(Download)
sys.path.append('../')
import numpy
from classes import SignaturePermutationWithTrie, Document, RandomGaussianUnitVector,\
    VectorPermutation
from library.vector import Vector
            if wordDimension not in vector: vector[wordDimension]=1
            else: vector[wordDimension]+=1
        return Document(docId, vector, clusterId=words[0])
 
    dimensions = 53
    for document in traningDocumentsMap.values(): clusterToDocumentsMap[document.clusterId].append(document)
    clusterMap = {}
    for k, v in clusterToDocumentsMap.iteritems(): clusterMap[k]=Document(docId=k, vector=Vector.getMeanVector(v), clusterId=k)
 
    # Create signatures and signaturePermutations for all the clusters.

src/s/t/streaming_lsh-HEAD/streaming_lsh/demo/StreamingLSHClusteringDemo.py   streaming_lsh(Download)
from streaming_lsh_clustering import StreamingLSHClustering
from library.file_io import FileIO 
from classes import Document
from library.vector import Vector
from library.clustering import EvaluationMetrics
        if word not in vector: vector[word]=1
        else: vector[word]+=1
    return Document(docId, vector, clusterId=words[0])
 
 

src/s/t/streaming_lsh-HEAD/streaming_lsh/nearest_neighbor_lsh.py   streaming_lsh(Download)
@author: kykamath
'''
from classes import RandomGaussianUnitVector, VectorPermutation,\
    SignaturePermutationWithTrie, UtilityMethods, Document,\
    SignaturePermutationWithSortedList

src/s/t/streaming_lsh-HEAD/streaming_lsh/tests/classes_tests.py   streaming_lsh(Download)
from Bio import trie
from library.classes import TwoWayMap
from classes import Signature, SignaturePermutationWithTrie, SignatureTrie, Document,\
    RandomGaussianUnitVector, Permutation, VectorPermutation, Cluster,\
    UtilityMethods
        permutatedUnitVectors = [unitVector.getPermutedVector(r) for r in vectorPermutations]
        documentVector = VectorGenerator.getRandomGaussianUnitVector(dimension=dimensions, mu=0, sigma=1)
        documentWithSignatureByVectors=Document(1, documentVector)
        documentWithSignatureByVectorPermutations=Document(2, documentVector)
        documentWithSignatureByVectors.setSignatureUsingVectors(permutatedUnitVectors, phraseTextAndDimensionMap)
    def test_setSignatureUsingVectors(self):
        phraseTextAndDimensionMap = TwoWayMap()
        phraseTextAndDimensionMap.set(TwoWayMap.MAP_FORWARD, 'a', 1)
        phraseTextAndDimensionMap.set(TwoWayMap.MAP_FORWARD, 'b', 2)
        documentWithDimensionsInVector = Document(1, {'a':1, 'b':4})
        documentWithDimensionsNotInVector = Document(1, {'a':1, 'c':4})

src/s/t/streaming_lsh-HEAD/streaming_lsh/tests/nearest_neighbor_lsh_tests.py   streaming_lsh(Download)
from library.file_io import FileIO
from library.vector import Vector
from classes import Document
 
nns_settings = {'dimensions': 53,
        if word not in vector: vector[word]=1
        else: vector[word]+=1
    return Document(words[0], vector)
i = 0
documents = []