kaz-Anova / ensemble_amazon

Code to share different ensemble techniques with focus on meta-stacking , using data from Amazon.com - Employee Access Challenge kaggle competition
Apache License 2.0
220 stars 79 forks source link

There is a error in XGBoostClassifier.py when I run amazon_main_xgboost.py. How can I solve it? #1

Open sccbhxc opened 7 years ago

sccbhxc commented 7 years ago

The error detail as below: Traceback (most recent call last): File "D:\Project\Tree\ensemble_amazon-master\amazon_main_xgboost.py", line 198, in preds=bagged_set(X_train,y_train,model, SEED , bagging, X_cv, update_seed=True)
File "D:\Project\Tree\ensemble_amazon-master\amazon_main_xgboost.py", line 59, in bagged_set model.fit(X_t,y_c) # fit model0.0917411475506 File "D:\Project\Tree\ensemble_amazon-master\XGBoostClassifier.py", line 147, in fit self.bst = xgb.train(param.items(), X1, self.num_round) File "C:\Anaconda3\envs\py27\lib\site-packages\xgboost-0.6-py2.7.egg\xgboost\training.py", line 204, in train xgb_model=xgb_model, callbacks=callbacks) File "C:\Anaconda3\envs\py27\lib\site-packages\xgboost-0.6-py2.7.egg\xgboost\training.py", line 74, in _train_internal bst.update(dtrain, i, obj) File "C:\Anaconda3\envs\py27\lib\site-packages\xgboost-0.6-py2.7.egg\xgboost\core.py", line 819, in update _check_call(_LIB.XGBoosterUpdateOneIter(self.handle, iteration, dtrain.handle)) File "C:\Anaconda3\envs\py27\lib\site-packages\xgboost-0.6-py2.7.egg\xgboost\core.py", line 127, in _check_call raise XGBoostError(_LIB.XGBGetLastError()) xgboost.core.XGBoostError: Invalid Input: '0', valid values are: {'learn', 'left', 'right'}

kaz-Anova commented 7 years ago

I see.

Your version of xgboost is more recent than the example.

You need to do to https://github.com/kaz-Anova/ensemble_amazon/blob/master/XGBoostClassifier.py

and change default_direction=0 to default_direction ='learn'.

or I think you can just replace XGBoostClassifier.py with the one I have attached.

Let me know if it runs now.

Marios

XGBoostClassifier.zip

sccbhxc commented 7 years ago

@kaz-Anova Thanks you for answering me so promptly. Now the program is runing. I am waiting for the result.