Git Product home page Git Product logo

factor_model's Introduction

使用Factor生成因子

1. 运行程序

factor.feather放在目录./data/下,之后运行如下指令来生成每日的数据点。所有的数据点会放在./data/daypoint/目录下,因此需要先创建该目录:

python generate_daypoint.py

之后根据生成的数据训练模型。模型结果会放在目录./data/result/目录下。训练模型的程序参数如下:

  1. --end:指定训练数据的结束日期,这里多加了一天,保证6月30也包括进去,实际上不需要。保存模型的名称也会根据这个参数指定;
  2. --device:指定训练使用的设备,cpu或者gpu
python main.py --end 2018-06-31 --device cuda

训练玩模型之后根据模型预测后半年的结果,程序的参数如下:

  1. --start:起始时间;
  2. --end:结束时间
  3. --model:选择使用哪一个模型,例子中使用了上面训练的2018-06-31的模型
  4. --device:同上
python prediction.py --start 2018-07-01 --end 2018-12-32 --model 2018-06-31 --device cuda

2. 回测结果

使用LSTM进行训练并且进行日频回测,最终结果如下:

back test

具体的半年训练一次的统计量结果如下:

Date IC Mean IC Std Rank IC IC_IR positive_ic
2018-12-32 0.03723 0.03849 0.03464 0.96735 0.82258
2019-06-31 0.04096 0.04199 0.04784 0.97530 0.84746
2019-06-31 0.04270 0.03983 0.04446 1.07197 0.84746
2019-12-32 0.03912 0.04538 0.02551 0.86203 0.81746
2020-06-31 0.04571 0.06094 0.03623 0.75000 0.80342
2020-12-32 0.03608 0.04822 0.02986 0.74812 0.82540
2021-06-31 0.04639 0.04248 0.03267 1.09219 0.85593
2021-12-32 0.03144 0.04268 0.02488 0.73657 0.76000
2022-06-31 0.04462 0.05210 0.03578 0.85641 0.81081

factor_model's People

Contributors

yxr620 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.