1
$\begingroup$

I want to classify imbalance data in two class and I want to use oversampling, undersampling and Synthetic data generation methods .for tuning my model i want use k-fold cross validation what should i do first? balancing data and then use cross validation or vice versa?

$\endgroup$
  • 1
    $\begingroup$ The answer is neither. You do the oversampling/undersampling within the cross validation. That is, you split the data, oversample the training set only, and leave the validation/test set alone. If you are oversampling because there is a class distribution problem, then when splitting the data use stratified sampling so that your test set is reflective of what you observe in your data. $\endgroup$ – aranglol Apr 29 '19 at 15:39
0
$\begingroup$

Without addressing the question of whether over-sampling or under-sampling is an appropriate approach, over-sampling before CV will cause data-leakage, as the same data point might be present in both the CV-test and training set.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.