M4metalearning icon indicating copy to clipboard operation
M4metalearning copied to clipboard

hyperparamter_search not running over all folds?

Open sebastianrosengren opened this issue 3 years ago • 2 comments

for loop running 1:1

for (i in 1:1) {
  dtrain <- xgboost::xgb.DMatrix(train_feat[[i]]$data)
  attr(dtrain, "errors") <- train_feat[[i]]$errors

  bst <- xgboost::xgb.train(param, dtrain, nrounds)
  preds <- M4metalearning::predict_selection_ensemble(bst, test_feat[[i]]$data)
  er <- M4metalearning::summary_performance(preds,
                                            test_ds[[i]],
                                            print.summary = FALSE)

  final_error <- c(final_error, er$weighted_error)
  final_preds <- rbind(final_preds, preds)
}

Should maybe be 1.length(folds) ?

sebastianrosengren avatar Sep 01 '21 13:09 sebastianrosengren

Hi Sebastian, you are right, the loop could run for all the folds. It is done that way for computational reasons. It is doing a holdout validation (so just an approximation anyways) that runs inside a bayesian optimization loop. So you can also modify the number of rounds of bayesian optimization if you want to find a better solution.

pmontman avatar Sep 02 '21 08:09 pmontman

Hi,

Sorry for the late appreciation post. Thanks for taking the time and clarifying this.

Much appreciated!

sebastianrosengren avatar Sep 15 '21 14:09 sebastianrosengren