Did I find the right examples for you? yes no

All Samples(9)  |  Call(5)  |  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
    def __init__(self, **clustering_settings):
        self.thresholdForDocumentToBeInACluster = clustering_settings['threshold_for_document_to_be_in_cluster']
        self.unitVector = RandomGaussianUnitVector(dimensions=clustering_settings['dimensions'], mu=0, sigma=1)
        self.vectorPermutations = VectorPermutation.getPermutations(clustering_settings['signature_length'], clustering_settings['dimensions'], self.unitVector)
        signatureType = clustering_settings.get('signature_type', 'signature_type_trie')

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
    def __init__(self, **settings):
        self.settings = settings
        self.nearestNeighborThreshold = settings['nearest_neighbor_threshold']
        self.unitVector = RandomGaussianUnitVector(dimensions=settings['dimensions'], mu=0, sigma=1)
        self.vectorPermutations = VectorPermutation.getPermutations(settings['signature_length'], settings['dimensions'], self.unitVector)

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

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
        for i in range(dimensions-50): phraseTextAndDimensionMapWithMissingDimensions.set(TwoWayMap.MAP_FORWARD, i,i)
 
        unitVector = RandomGaussianUnitVector(dimensions=dimensions, mu=0, sigma=1)
        vectorPermutations = VectorPermutation.getPermutations(signatureLength, dimensions, unitVector)
        permutatedUnitVectors = [unitVector.getPermutedVector(r) for r in vectorPermutations]
    def setUp(self): 
        self.vector = RandomGaussianUnitVector(dimensions=5, mu=0, sigma=1)
        self.permutation = VectorPermutation(dimensions=5)
    def test_initialization(self): self.assertEquals('%0.0f'%self.vector.mod(),'1')
    def test_getPermutedDimensionValue(self): self.assertEqual(self.vector[self.permutation.applyFunction(10)], self.vector.getPermutedDimensionValue(self.permutation, 10))