Guest User

Untitled

a guest
Sep 14th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. def update_matrix(self, pair, input):
  2.  
  3. self.matrix[pair][input]['n_obs'] = self.matrix[pair][input]['n_obs'] + 1
  4.  
  5. n_total = 0
  6. for i in self.matrix[pair]:
  7. n_total += self.matrix[pair][i]['n_obs']
  8.  
  9. for i in self.matrix[pair]:
  10. self.matrix[pair][i]['prob'] = self.matrix[pair][i]['n_obs'] / n_total
Add Comment
Please, Sign In to add comment