jgpavez / LSTM---Stock-prediction

A long term short term memory recurrent neural network to predict forex data time series
306 stars 149 forks source link

read_data issue #1

Open camcamc opened 9 years ago

camcamc commented 9 years ago

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 commented 8 years ago

update your sklearn version to 0.17 would fix the problem