You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I keep getting this error and I don't know how to solve it, as far as I know my data is in the correct format, single columns for both x and y
File "D:\Anaconda\envs\py3.6\lib\site-packages\xgboost-1.0.0_snapshot-py3.6.egg\xgboost\sklearn.py", line 680, in fit
self._features_count = X.shape[1]
IndexError: tuple index out of range
Code to reproduce this is as follows (run on Windows 10 x64 machine, XGBoost installed to Anaconda env)
import numpy as np
from sklearn.datasets import fetch_20newsgroups
twenty_train = fetch_20newsgroups(subset='train', shuffle=True)
import os
mingw_path = 'C:\\Program Files\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin'
os.environ['PATH'] = mingw_path + ';' + os.environ['PATH']
import xgboost as xgb
from xgboost import XGBClassifier
from sklearn.model_selection import train_test_split
x_train, x_test, y_train, y_test = train_test_split(np.array(twenty_train.data), np.array(twenty_train.target), test_size=0.2, random_state=1)
model = XGBClassifier()
model.fit(x_train, y_train)
The text was updated successfully, but these errors were encountered:
I keep getting this error and I don't know how to solve it, as far as I know my data is in the correct format, single columns for both x and y
Code to reproduce this is as follows (run on Windows 10 x64 machine, XGBoost installed to Anaconda env)
The text was updated successfully, but these errors were encountered: