深度学习的“序列窗口滚动模块-dl_convert_to_bin”是不是有bug?

机器学习
标签: #<Tag:0x00007fb001391da0>

(BigQuant_9527) #1
[2019-05-13 21:22:33.765420] ERROR: bigquant: module name: dl_convert_to_bin, module version: v2, trackeback: Traceback (most recent call last):\nAttributeError: 'DataFrame' object has no attribute 'tolist'\n
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1-23bc8073ed22> in <module>()
    282     feature_clip=5,
    283     flatten=True,
--> 284     window_along_col='instrument'
    285 )
    286 

/var/app/enabled/biglearning/module2/common/modulemanagerv2.cpython-35m-x86_64-linux-gnu.so in biglearning.module2.common.modulemanagerv2.BigQuantModuleVersion.__call__()

/var/app/enabled/biglearning/module2/common/moduleinvoker.cpython-35m-x86_64-linux-gnu.so in biglearning.module2.common.moduleinvoker.module_invoke()

/var/app/enabled/biglearning/module2/common/moduleinvoker.cpython-35m-x86_64-linux-gnu.so in biglearning.module2.common.moduleinvoker._invoke_with_cache()

/var/app/enabled/biglearning/module2/common/moduleinvoker.cpython-35m-x86_64-linux-gnu.so in biglearning.module2.common.moduleinvoker._invoke_with_cache()

/var/app/enabled/biglearning/module2/common/moduleinvoker.cpython-35m-x86_64-linux-gnu.so in biglearning.module2.common.moduleinvoker._module_run()

/var/app/enabled/biglearning/module2/modules/dl_convert_to_bin/v2/__init__.py in run(self)
     42         data = {}
     43         if self._window_size > 1:
---> 44             feature_list = list(data_generator(df, self._features, window_size=self._window_size, window_along_col=self._window_along_col))
     45             feature_array = np.asarray(feature_list, np.float32)
     46             if self._flatten:

/var/app/enabled/biglearning/module2/modules/dl_convert_to_bin/v2/__init__.py in data_generator(data_df, feature_list, window_size, window_along_col)
     79     # 如果window_size大于1,需要找到对应股票前一个几个date的特征
     80     if window_along_col:
---> 81         instrument_id2data_id_list = data_df.groupby(window_along_col).apply(lambda x: list(x.index)).tolist()  # instrument_id 到data_id的对应
     82     else:
     83         instrument_id2data_id_list = [list(data_df.index)]  # instrument_id 到data_id的对应

/usr/local/python3/lib/python3.5/site-packages/pandas/core/generic.py in __getattr__(self, name)
   3612             if name in self._info_axis:
   3613                 return self[name]
-> 3614             return object.__getattribute__(self, name)
   3615 
   3616     def __setattr__(self, name, value):

AttributeError: 'DataFrame' object has no attribute 'tolist'

(达达) #2

这个可以详细说明一下么?


(小Q) #3

这个模块使用起来报错的话,建议将报错的策略一并分享,我们可以复现了看看是否存在问题。


(BigQuant_9527) #4

notebook_id=bd722cf8-7581-11e9-b0b9-0a580a8105e7


(达达) #5

修改一下基础特征抽取模块的before_days 调大点比如90试试看