I've got some unbalanced data in my LabeledPoint
. what I want to do is select all positives and n
times more negatives (randomly). For example if I have a 100
positives and 30000
negatives, I want to create new LabeledPoint
with all 100
positives and 300
negatives (n=3
).
And in real scenario I don't how many positives and negatives I have on the beginning.