Long time for running hyperparameter tuning codes

  Kiến thức lập trình

I have problems with long-time consumption in grid search. Can I have some help for hyperparameter tunning by grid search in catboost? R language

`Code 1: 7 seconds

grid <- expand.grid(depth  = 2,
                learning_rate = 0.01,
                iterations = 100,
                l2_leaf_reg = 10,
                rsm = 0.8,
                border_count=32)




report <- train( HAPO_7yrs_imputed1[, -1], as.factor(make.names(HAPO_7yrs_imputed1[, 1])),
             class_weights=c(1,1.5,15),
            method = catboost.caret,
            logging_level = 'Verbose', preProc = NULL,
            tuneGrid = grid, trControl = fit_control) 

Code 2: 7 mins

grid <- expand.grid(depth  = 10,
                learning_rate = 0.01,
                iterations = 1000,
                l2_leaf_reg = 0.1,
                rsm = 1,
                border_count=256)




report <- train( HAPO_7yrs_imputed1[, -1], as.factor(make.names(HAPO_7yrs_imputed1[, 1])),
             class_weights=c(1,1.5,15),
            method = catboost.caret,
            logging_level = 'Verbose', preProc = NULL,
            tuneGrid = grid, trControl = fit_control) 



Code 3: still running after 10 hours

grid <- expand.grid(depth = seq(2,10,length.out=2),
                learning_rate = seq(0.01,0.3,length.out=2),
                iterations = c(100,1000),
                l2_leaf_reg = 10^seq(-1,2,length.out=2),
                rsm = seq(0.8,1,length.out=2),
                border_count=32*2^seq(0,3,length.out=2)
                )




report <- train( HAPO_7yrs_imputed1[, -1], as.factor(make.names(HAPO_7yrs_imputed1[, 1])),
             class_weights=c(1,1.5,15),
            method = catboost.caret,
            logging_level = 'Verbose', preProc = NULL,
            tuneGrid = grid, trControl = fit_control) `

I tried to set only one pair of hyperparameters (plz see code 1 and code 2) and record their time consumption.

I would like to know how to reduce time in grid search for hyperparameter tuning.

Thank you!

New contributor

Yingchai ZHANG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT