LightGBM icon indicating copy to clipboard operation
LightGBM copied to clipboard

Random Forest for regression in LightGBM?

Open yoshimoncho opened this issue 8 years ago • 7 comments

Hi, I've been trying to use RF with regression objective in LightGBM for python, but the loss value never decreases. Even if I tune the parameters it never decreases. Is Random Forest implemented for regression in LightGBM for python?

yoshimoncho avatar Feb 19 '18 11:02 yoshimoncho

Are you using subsampling and column sampling? If you use Random Forest without sampling, it will learn from a single tree only as all trees would become identical to the first one.

Laurae2 avatar Feb 19 '18 11:02 Laurae2

@Laurae2 Sure, with a value of 0.8...

yoshimoncho avatar Feb 19 '18 11:02 yoshimoncho

Can you provide a reproducible script?

Laurae2 avatar Feb 19 '18 11:02 Laurae2

@Laurae2 I've used this parameters... param = {'num_leaves':300, 'objective':'regression', 'max_depth':-1, 'learning_rate':0.01, "min_child_samples":20, "boosting":"rf", "feature_fraction":0.4, "bagging_freq":10, "bagging_fraction":0.4 , "bin_construct_sample_cnt":200000, "bagging_seed": 11} param['metric'] = ['mae']

yoshimoncho avatar Feb 19 '18 11:02 yoshimoncho

@Laurae2 This is the relevant part of my script: train_data=lgb.Dataset(X_new_train,label=y_new_train) validation_data = lgb.Dataset(X_val,label=y_val) num_round = 100 clf2=lgb.train(param,train_data,num_round,valid_sets = [validation_data],early_stopping_rounds = 100,categorical_feature = [59] ) predictions=clf2.predict(X_test)

yoshimoncho avatar Feb 19 '18 11:02 yoshimoncho

@yoshimoncho it is better to use bagging_freq=1 for RF.

guolinke avatar Feb 23 '18 06:02 guolinke

Is it possible to get the value of each estimator in random_forests to generate prediction intervals/uncertainty estimates?

vruvora avatar Mar 06 '18 22:03 vruvora