Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. def _get_label_proportions(self, dataset):
  2. pos, neg = [], []
  3. # split examples into positives and negatives so we know the proportions
  4. for example in dataset:
  5. if not example[-1]:
  6. neg.append(example)
  7. else:
  8. pos.append(example)
  9. num_pos = len(pos) / len(dataset)
  10. num_neg = len(neg) / len(dataset)
  11. return num_pos, num_neg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement