yanyachen / rBayesianOptimization

Bayesian Optimization of Hyperparameters
85 stars 21 forks source link

error in data.table(NULL, NULL, NULL, NULL, NULL, NULL : column or argument 1 is NULL #34

Open alex7tula opened 6 years ago

alex7tula commented 6 years ago

Hi, i try to run

OPT_Res <- BayesianOptimization(FUN, bounds = bonds,init_grid_dt = NULL, init_points = 3, n_iter = 3, acq = "ucb", kappa = 2.576, eps = 0.0, verbose = TRUE);
grid_dt=OPT_Res$History[,-1];# Remove Rounds   

All above is Ok. Then

OPT_Res <- BayesianOptimization(FUN, bounds = bonds,init_grid_dt = grid_dt, init_points = 3, n_iter = 3, acq = "ucb", kappa = 2.576, eps = 0.0, verbose = TRUE);

Here i get error in line 203 Pred_DT <- data.table::as.data.table(Pred_list) : data.table(NULL, NULL, NULL, NULL, NULL, NULL: column or argument 1 is NULL

I check Pred_list. First 6 items filled by NULL, next filled by matrix with calculated prdictions. In line 127 you create it and left as NULL Pred_list <- vector(mode = "list", length = nrow(DT_history))

I replase line 133 next to Pred_list[[i]] <- 0; next;

Now all runs without errors. Please correct your version.

alex7tula commented 6 years ago

Other way - not fill Pred by real data in FUN. return(list(Score = Score, Pred = 0))

alex7tula commented 6 years ago

What sense to use Pred? you use BayesianOptimization only as tube to transfer to external function? If it is required i can to save Pred to a global variable.