Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def update_matrix(self, pair, input):
- self.matrix[pair][input]['n_obs'] = self.matrix[pair][input]['n_obs'] + 1
- n_total = 0
- for i in self.matrix[pair]:
- n_total += self.matrix[pair][i]['n_obs']
- for i in self.matrix[pair]:
- self.matrix[pair][i]['prob'] = self.matrix[pair][i]['n_obs'] / n_total
Add Comment
Please, Sign In to add comment