0
$\begingroup$

I have a dataset of audio recording of variable length with large std which are heavily imbalanced in terms of total duration per class. So in stratified k-fold cross validation I would like to main the relative total duration statistics for each class but the common stratified sampling methods work using number of examples per class. So how can I achieve duration statistic preserving stratified sampling?

$\endgroup$

1 Answer 1

0
$\begingroup$

Easiest is to transform the dataset into a set of fixed-length samples - as then the number of instances will again be a good measure of the amount of data. This is often called analysis window in audio machine learning. This has other benefits as well, like making it possible to implement time-shift data augmentation (by letting the windows overlap) and merging predictions over multiple windows. As well as supporting the use of models which expect a fixed-size input.

The other alternative would be to write your own cross-validator splitter, using the logic that you want wrt duration.

$\endgroup$

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.