microsoft / LightGBM

A fast, distributed, high performance gradient boosting (GBT, GBDT, GBRT, GBM or MART) framework based on decision tree algorithms, used for ranking, classification and many other machine learning tasks.
https://lightgbm.readthedocs.io/en/latest/
MIT License
16.48k stars 3.82k forks source link

top_rate + other_rate parameters restriction cannot be greater than or equal to 1 #2501

Closed brunogasperini closed 4 years ago

brunogasperini commented 4 years ago

Hello,

I'm tuning a LightGBM model using its goss version. However, I'm running into an issue where I cannot set the top_rate and other_rate in a way that their sum is greater than or equal to 1.

From the first paragraph in page 6 of the NIPS paper (emphasis in bold are mine),

Specifically, GOSS firstly sorts the data instances according to the absolute value of their gradients and selects the top a×100% instances. Then it randomly samples b×100% instances from the rest of the data

So my understanding is that there should be no restriction in the values of these parameters, besides both being within [0,1].

For example. a data with 1,000 observations and top_rate=0.6 and other_rate=0.5 would select the first 600 observations (sorted by the absolute value of their gradients) and then would pick 200(=0.5*0.4*600) observations from the rest of the data.

However, based on the error, it seems that the other_rate is not picking what's left, but rather picking the share of original sample.

Any ideas?

Thanks!

Environment info

Operating System: UNIX

CPU/GPU model: AWS EC2 r5.24xlarge

C++/Python/R version: Python v3.6

LightGBM version or commit hash: 2.3.0

Error message

LightGBMError: Check failed: config_->top_rate + config_->other_rate <= 1.0f at /tmp/pip-req-build-zww_zxel/compile/src/boosting/goss.hpp, line 63 .

Reproducible examples

Below is one hyperparameter configuration that leads to the above error

hp_dict = {
    'objective': ['binary'],  
    'metric': ['auc'],  
    'boosting': ['goss'],  
    'seed': [210988],   
    'learning_rate': [0.05],  
    'max_depth': [4], 
    'num_leaves': [7],  
    'min_data_in_leaf': [100], 
    'feature_fraction': [1], 
    'top_rate': [0.6],  # default = 0.2 (goss parameter)
    'other_rate': [0.5],  # default = 0.1 (goss parameter)
    'max_bin': [255], 
    'scale_pos_weight': [1],
}
guolinke commented 4 years ago

@brunogasperini sorry, I think the sentence cause the misleading. We mean the bx100% (of the full dataset) from the rest data.