示例#1
0
def get_child_parset_rand(db, N):
    s = PatentSampler(db, 'traits')
    """ Get a (generator) list (length N) of two-tuples (child,parents), 
    where parents is a list of patents which are cited by child. Must make some
    choice about how many parents each patent has (use average?)"""
    pass
示例#2
0
def get_par_childset_rand(db, N):
    s = PatentSampler(db, 'traits')
    """ Get a (generator) list (length N) of two-tuples (parent, children) 
    where children is a list of patents which cite parent. Must make some choice about
    how many children each patent has (use average?)"""
    pass
示例#3
0
def get_rand_pairs(db, N):
    """ Get a (generator) list (length N) of random pairs (x,y) of patents."""
    sampler = PatentSampler(db, 'traits')
    rand_pats = sampler.sample(N*2)
    rand_pairs = ((rand_pats[2*i], rand_pats[2*i+1]) for i in range(N))
    return rand_pairs
示例#4
0
 def testPatnsWorks(self):
     sampler = PatentSampler(self.db, 'patns')
     sampler.sample(1)
示例#5
0
 def testTraitsWorks(self):
     sampler = PatentSampler(self.db, 'just_cites')
     sampler.sample(1)
示例#6
0
 def testTraitsWorks(self):
     sampler = PatentSampler(self.db, 'pat_text')
     sampler.sample(1)
示例#7
0
 def testCiteNetWorks(self):
     sampler = PatentSampler(self.db, 'cite_net')
     sampler.sample(1)