Generalized Oversampling for Learning from Imbalanced datasets and Associated Theory