Fix stratified folding mistake in remainders

This commit is contained in:
2023-07-27 16:51:27 +02:00
parent 3d8fea7a37
commit 7f7ddad36a
8 changed files with 18 additions and 8 deletions

View File

@@ -72,7 +72,7 @@ void StratifiedKFold::build()
}
while (remainder_samples_to_take > 0) {
int fold = (rand() % static_cast<int>(k));
if (stratified_indices[fold].size() == fold_size) {
if (stratified_indices[fold].size() == fold_size + 1) {
continue;
}
auto it = next(class_indices[label].begin(), 1);