Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def _get_label_proportions(self, dataset):
- pos, neg = [], []
- # split examples into positives and negatives so we know the proportions
- for example in dataset:
- if not example[-1]:
- neg.append(example)
- else:
- pos.append(example)
- num_pos = len(pos) / len(dataset)
- num_neg = len(neg) / len(dataset)
- return num_pos, num_neg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement