Restore the Creation model position in experiment

This commit is contained in:
Ricardo Montañana Gómez 2023-11-17 01:10:46 +01:00
parent e2249eace7
commit f088df14fd
Signed by: rmontanana
GPG Key ID: 46064262FD9A7ADE

View File

@ -168,8 +168,8 @@ namespace platform {
fold = new StratifiedKFold(nfolds, y, seed);
else
fold = new KFold(nfolds, y.size(0), seed);
auto clf = Models::instance()->create(model);
for (int nfold = 0; nfold < nfolds; nfold++) {
auto clf = Models::instance()->create(model);
setModelVersion(clf->getVersion());
if (hyperparameters.size() != 0) {
clf->setHyperparameters(hyperparameters);
@ -212,7 +212,6 @@ namespace platform {
result.addTimeTest(test_time[item].item<double>());
item++;
}
clf.reset();
if (!quiet)
std::cout << "end. " << flush;
delete fold;