lukovkin / ufcnn-keras

Implementation of UFCNN in Keras
MIT License
93 stars 26 forks source link

Error running with new signal files #5

Closed developeralgo8888 closed 8 years ago

developeralgo8888 commented 8 years ago

We need to adjust the UFCNN1.py to deal with new signal files. The new signal file has string headers while the old format does not

new signal file format: ( contains headers or column names in the file)

time,signal,Buy,Sell,Buys,Sells
39645049,0.0,0.0,0.0,0.0,0.0 39645566,0.0,0.0,0.0,0.0,0.0 39646067,0.0,0.0,0.0,0.0,0.0

Old Signal file format: ( contains no headers or column names in the file)

39671561,0.0 39672375,0.0 39672908,1.0 39673412,1.0 39674229,1.0

/home/test/ufcnn-keras-master/models# python UFCNN1.py tradcom_simple ..... .... ... ..... Traceback (most recent call last): File "UFCNN1.py", line 931, in (X, y, mean, std) = prepare_tradcom_classification(training=True, ret_type='df', sequence_length=500, features_list=features_list, output_dim=3, file_list=file_list) File "UFCNN1.py", line 587, in prepare_tradcom_classification ydf['sell'] = ydf.apply(lambda row: (1 if row['signal'] < -0.9 else 0 ), axis=1) File "/home/anaconda3/lib/python3.5/site-packages/pandas/core/frame.py", line 3972, in apply return self._apply_standard(f, axis, reduce=reduce) File "/home/anaconda3/lib/python3.5/site-packages/pandas/core/frame.py", line 4064, in _apply_standard results[i] = func(v) File "UFCNN1.py", line 587, in ydf['sell'] = ydf.apply(lambda row: (1 if row['signal'] < -0.9 else 0 ), axis=1) TypeError: ('unorderable types: str() < float()', 'occurred at index (2013-01-03 05:00:00, Buys)')