I am facing a problem with imbalanced dataset in which I would like to detect the rare event. My questions are more of general strategy about the whole workflow and I would like to hear your thoughts suggestions.
Data budget:
How should i split my dataset into training/validation(?)/threshold tuning(?)/test set? I will expand on this question as we go.
Hyperparameter tuning using cross-validation:
I think based on this post that it would be more wise to set the objective of the hyperparameter tuning algorithm (e.g. Optuna) to be a loss function (e.g. brier score loss) rather than a hard class metric like f1-score. The reason is that a hard class metric like f1-score would be optimised based on a decision threshold of 0.5 which would probably require tuning later.
Another matter which should be considered during this phase are the class weights which are more preferable to upsampling/downsampling techniques based on my understanding of these 1, 2. Would it be wise to balance them out and be done with it or tune them as well using example pos_weight for XGBoost?
Decision Threshold:
After finishing with with the hyperparameter tuning, the next phase would be to tune the decision threshold (not actually necessary but requested by the decision-makers usually) for example by using the sklearn's TunedThresholdClassifierCV and the desired metric (e.g. f1-score). In order to do that we would need an extra set of data other than the training data which we can call ThresholdTuning set. How large should that be based on your experience?
Would it make sense to use the same set to perform feature selection using sklearn's permutation_importance? Should the scoring of the permutation importance be based on the brier score loss once again?
Model validation:
After hyperparameter tuning and threshold tuning, would it make sense to proceed to testing using the test set or should a validation set be included as well prior to that? What % of the initial dataset should the validation and test set be in this case especially in cases of small amount of data (say 5000)?
Sorry for the long post, I look forward to hearing your thoughts/suggestions.