Last active
July 27, 2017 23:44
-
-
Save ybenjo/4d7a37262fb46c64a26eecef579004ba to your computer and use it in GitHub Desktop.
xgboost bug (Classifier can't handle nested array)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from xgboost import XGBClassifier | |
model = XGBClassifier(seed = 1) | |
# XOR Pattern | |
train_data = [ | |
[1, 0], | |
[0, 1], | |
[1, 1], | |
[0, 0], | |
] | |
train_y = [1, 1, 0, 0] | |
model.fit(train_data, train_y) | |
# File "$HOME/.pyenv/versions/3.4.5/lib/python3.4/site-packages/xgboost/sklearn.py", line 432, in fit | |
# self._features_count = X.shape[1] | |
# AttributeError: 'list' object has no attribute 'shape' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment