Fix stratified when class samples were less than folds

Add more tests to make them more robust
This commit is contained in:
2024-05-11 13:25:07 +02:00
parent 71d6055be4
commit 306a9e1fc8
162 changed files with 133215 additions and 315 deletions

View File

@@ -5,7 +5,7 @@
#include <random>
#include <vector>
namespace folding {
const std::string FOLDING_VERSION = "1.0.1";
const std::string FOLDING_VERSION = "1.1.0";
class Fold {
protected:
int k;
@@ -78,7 +78,6 @@ namespace folding {
std::cerr << "Warning! The number of samples in class " << label << " (" << class_counts.at(label)
<< ") is less than the number of folds (" << k << ")." << std::endl;
faulty = true;
continue;
}
auto remainder_samples_to_take = class_counts[label] % k;
for (auto fold = 0; fold < k; ++fold) {