bigdong89 / xgboostExtension

xgboost Extension for Easy Ranking & TreeFeature
Apache License 2.0
123 stars 35 forks source link

AttributeError: 'XGBRanker' object has no attribute 'nthread' #21

Open simpsus opened 3 years ago

simpsus commented 3 years ago

executing the example ranking code I get the following error. It seems to me a parameter is used that is not supported by xgboost.


AttributeError Traceback (most recent call last) c:\Users\basti\Documents\numer.ai\ranking_xgboost_gpu.py in 35 36 ---> 37 ranker.fit(X, y)#, eval_metric=['ndcg', 'map@5-']) 38 y_predict = ranker.predict(X) 39

~\Anaconda3\envs\numerai\lib\site-packages\xgboostextension\xgbranker.py in fit(self, X, y, sample_weight, eval_set, eval_metric, early_stopping_rounds, verbose, xgbmodel) 71 sizes, , Xfeatures, y, = _preprare_data_in_groups(X, y) 72 ---> 73 params = self.get_xgb_params() 74 75 if callable(self.objective):

~\Anaconda3\envs\numerai\lib\site-packages\xgboost\sklearn.py in get_xgb_params(self) 394 def get_xgb_params(self): 395 """Get xgboost specific parameters.""" --> 396 params = self.get_params() 397 # Parameters that should not go into native learner. 398 wrapper_specific = {

~\Anaconda3\envs\numerai\lib\site-packages\xgboost\sklearn.py in get_params(self, deep) 351 # 2. Return whatever in **kwargs. 352 # 3. Merge them. --> 353 params = super().get_params(deep) 354 cp = copy.copy(self) 355 cp.class = cp.class.bases[0]

~\Anaconda3\envs\numerai\lib\site-packages\sklearn\base.py in get_params(self, deep) 193 out = dict() 194 for key in self._get_param_names(): --> 195 value = getattr(self, key) 196 if deep and hasattr(value, 'get_params'): 197 deep_items = value.get_params().items()

AttributeError: 'XGBRanker' object has no attribute 'nthread'