0
$\begingroup$

I have a task to create credit scoring model using WOE encoding. I have a very small dataset, so I wont be able to perform testing on test and out-of-time samples. Thus, I am going to use cross-validation.

Can you please tell me which variant is correct:
1 Variant. I perform binning on my entire dataset. I calculate WOE. I replace the values of my variables by their WOE encoding. Then start cross-validation on 3 folds. I just split my entire dataset with WOE values on 3 parts and do cv. This leads to bias. In every iteration of cv, I have train and test samples, but WOE values in test samples were calculated using binning applied to entire dataset so WOE values in test sample are influenced by test sample. Does it sound correct? Is there a data leakage?
2 Variant. First I split my dataset according to 3 fold cv. Afterwards each iteration is processed in a such way that I perform binning and calculate WOEs on train sample, and then I replace values in test sample with those WOEs. 3 iterations = 3 different binnings. But WOEs from test sample will not be influenced by test sample because binning was performed on each iteration using only train dataset.
3 Variant. First I split my dataset according to 3 fold cv. Afterwards each iteration is processed in a such way that I use binning performed on entire dataset but calculate WOEs based on train sample, and then I replace values in test sample with those WOEs. 3 iterations = 3 different WOEs with same binning. Is there a data leakage?

Can you please tell me which way is correct and what do you think? I would be extremely grateful if you could share any publications and researches on cross-validation with WOE transformation. Thanks!

$\endgroup$

1 Answer 1

-1
$\begingroup$

I think you can try use bootstrap sampling, you also can retrieve some confidence interval for your's classifier error. https://hastie.su.domains/MOOC-Slides/cv_boot.pdf

$\endgroup$
1
  • $\begingroup$ Hi, I think your answer is irrelevant to my problem. I was asking about k-fold cross-validation with binning. Your paper doesnt have anything to do with binning at all. $\endgroup$
    – FedorT54
    Commented Oct 5, 2023 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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