diff --git a/src/Platform/Experiment.cc b/src/Platform/Experiment.cc index a8d1842..d683815 100644 --- a/src/Platform/Experiment.cc +++ b/src/Platform/Experiment.cc @@ -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()); item++; } - clf.reset(); if (!quiet) std::cout << "end. " << flush; delete fold;