Xtra-Computing / thundergbm

ThunderGBM: Fast GBDTs and Random Forests on GPUs
Apache License 2.0
689 stars 85 forks source link

About parameter 'num_round' in the document #30

Closed baibai25 closed 4 years ago

baibai25 commented 4 years ago

Hi! I ran the following command and got an error:

reg = tgb.TGBMRegressor(num_round=500)
reg.fit(X_train, y_train)

Exception ignored in: <bound method TGBMModel.__del__ of TGBMRegressor(bagging=None, column_sampling_rate=None, depth=None, gamma=None,
              lambda_tgbm=None, learning_rate=None, max_num_bin=None,
              min_child_weight=None, n_gpus=None, n_parallel_trees=None,
              n_trees=None, num_class=None, objective=None, tree_method=None,
              verbose=None)>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/thundergbm/thundergbm.py", line 74, in __del__
    if self.model is not None:
AttributeError: 'TGBMRegressor' object has no attribute 'model'

---------------------------------------------------------------------------

TypeError Traceback (most recent call last)

[<ipython-input-44-549c7ba30e91>](https://localhost:8080/#) in <module>()  ----> 1  reg  =  tgb.TGBMRegressor(num_round=500)  2  reg.fit(X_train,  y_train)  

TypeError: __init__() got an unexpected keyword argument 'num_round'

I checked thundergbm.py and changed the parameter from 'num_round' to 'n_trees' and ran it and it worked fine.

I suggest documentation updates.

Thank you

Kurt-Liuhf commented 4 years ago

Hi @baibai25, thanks for your kind reminder. We have already updated the documentation now and the parameter num_round was changed to n_trees.

baibai25 commented 4 years ago

@Kurt-Liuhf I appreciate your quick response! I also found some similar problems. Please confirm all parameters.

verbosity: verbose
max_depth: depth
max_bin: max_num_bin
colsample: column_sampling_rate
num_parallel_tree: n_parallel_trees
eta: learning_rate
lambda: lambda_tgbm
Kurt-Liuhf commented 4 years ago

Thanks again. That may cause inconvenience to your use of ThunderGBM since the parameters in the previous version of document were all for c++ command line. Now we have double-checked and fixed it.

baibai25 commented 4 years ago

@Kurt-Liuhf Thank you very much!