Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read_data issue #1

Open
camcamc opened this issue Jul 6, 2015 · 1 comment
Open

read_data issue #1

camcamc opened this issue Jul 6, 2015 · 1 comment

Comments

@camcamc
Copy link

camcamc commented Jul 6, 2015

The following code seems problematic: it turns x_data into 3D array and thus cv.split_train_test reports error:
x_data = numpy.array([data[i:i+max_len,:] for i in xrange(len(data)-max_len)])
y_data = numpy.array([data[i][0] for i in xrange(max_len , len(data))])

y_data, test_size=0.3, random_state=0)

File "/usr/lib/python2.7/dist-packages/sklearn/cross_validation.py", line 1556, in train_test_split
arrays = check_arrays(_arrays, *_options)
File "/usr/lib/python2.7/dist-packages/sklearn/utils/validation.py", line 287, in check_arrays
array.ndim)
ValueError: Found array with dim 3. Expected <= 2

@lanyastar
Copy link

update your sklearn version to 0.17 would fix the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants