Did I find the right examples for you? yes no

All Samples(10)  |  Call(6)  |  Derive(0)  |  Import(4)

src/s/t/streaming_lsh-HEAD/streaming_lsh/streaming_lsh_clustering.py   streaming_lsh(Download)
@author: kykamath
'''
from classes import RandomGaussianUnitVector, VectorPermutation,\
    SignaturePermutationWithTrie, Cluster, UtilityMethods,\
    SignaturePermutationWithSortedList
        self.vectorPermutations = VectorPermutation.getPermutations(clustering_settings['signature_length'], clustering_settings['dimensions'], self.unitVector)
        signatureType = clustering_settings.get('signature_type', 'signature_type_trie')
        if signatureType=='signature_type_trie': self.signaturePermutations = [SignaturePermutationWithTrie(clustering_settings['signature_length']) for i in range(clustering_settings['number_of_permutations'])]
        else: self.signaturePermutations = [SignaturePermutationWithSortedList(clustering_settings['signature_length']) for i in range(clustering_settings['number_of_permutations'])]
        self.phraseTextAndDimensionMap, self.clusters = TwoWayMap(), {}

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
 
        signatureType = settings.get('signature_type', 'signature_type_trie')
        if signatureType=='signature_type_trie': self.signaturePermutations = [SignaturePermutationWithTrie(settings['signature_length']) for i in range(settings['number_of_permutations'])]
        else: self.signaturePermutations = [SignaturePermutationWithSortedList(settings['signature_length']) for i in range(settings['number_of_permutations'])]
 

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
    unitVector = RandomGaussianUnitVector(dimensions=dimensions, mu=0, sigma=1)
    vectorPermutations = VectorPermutation.getPermutations(signatureLength, dimensions, unitVector)
    signaturePermutations = [SignaturePermutationWithTrie(signatureLength) for i in range(numberOfPermutations)]
 
    permutatedUnitVectors = [unitVector.getPermutedVector(r) for r in vectorPermutations]

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
        self.doc2=Document(2, VectorGenerator.getRandomGaussianUnitVector(dimension=self.dimension, mu=0, sigma=1))
        self.doc1.setSignatureUsingVectors(self.unitRandomVectors, self.phraseTextAndDimensionMap); self.doc2.setSignatureUsingVectors(self.unitRandomVectors, self.phraseTextAndDimensionMap)
        self.pm = SignaturePermutationWithTrie(signatureLength=self.signatureLength)
        self.pm.addDocument(self.doc1)
        self.pm.addDocument(self.doc2)
    def test_addDocument_newKey(self):
        doc1=Document(1, VectorGenerator.getRandomGaussianUnitVector(dimension=self.dimension, mu=0, sigma=1))
        doc1.setSignatureUsingVectors(self.unitRandomVectors, self.phraseTextAndDimensionMap)
        pm = SignaturePermutationWithTrie(signatureLength=self.signatureLength)
    def test_getNearestDocument_emptyTrie(self):
        permutationWithEmptyTrie = SignaturePermutationWithTrie(signatureLength=self.signatureLength)
        self.assertEqual(permutationWithEmptyTrie.getNearestDocuments(self.doc1), set())
    def test_removeDocument_documents(self):
        newDocModifiedWithExistingSignature = Document(3, VectorGenerator.getRandomGaussianUnitVector(dimension=self.dimension, mu=0, sigma=1))