-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
Hello! I'm a novice to hLDA and this might be wrong, but I'm wondering if the last (gamma)/(gamma+num_customers) really should be added for the leaves in calculate_ncrp_prior()? If we are on the lowest level, no new nodes can be added below, right?
def calculate_ncrp_prior(self, node_weights, node, weight):
''' Calculates the prior on the path according to the nested CRP '''
for child in node.children:
child_weight = log( float(child.customers) / (node.customers + self.gamma) )
self.calculate_ncrp_prior(node_weights, child, weight + child_weight)
node_weights[node] = weight + log( self.gamma / (node.customers + self.gamma))
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels