kera.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:Quantrade 作者: quant-trade 项目源码 文件源码
def make_feat(self):
        d = self.init_data()
        for i in range(1, 100):
            d['dif{}'.format(i)] = d.diff(i)
        for i in range(0, 9):
            d['hc{}'.format(i)] = d.HIGH.shift(i) - d.CLOSE.shift(i)
            d['lc{}'.format(i)] = d.LOW.shift(i) - d.CLOSE.shift(i)
            d['hl{}'.format(i)] = d.HIGH.shift(i) - d.LOW.shift(i)
            d['oc{}'.format(i)] = d.OPEN.shift(i) - d.CLOSE.shift(i)
            d['oh{}'.format(i)] = d.OPEN.shift(i) - d.HIGH.shift(i)
            d['ol{}'.format(i)] = d.OPEN.shift(i) - d.LOW.shift(i)
        d = d.fillna(0)
        d = preprocessing.scale(d)
        filename = join(self.out_poath, 'f_{0}.csv'.format(self.struc))
        d.to_csv(path_or_buf=filename)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号