请问因子库里的因子如何使用

新手专区
标签: #<Tag:0x00007fcf66877200>

(Paracelsus) #1

请教各位大大一个问题,咱们文档因子库里有好多因子可以供大家使用,我想把收盘价作为参考因子。但是我在插入了因子以后:

features = [
    'close_5'
    'close_10'
    'close_20'
     
]

运行却显示错误
WARNING: unknown fields: {‘close_5close_10close_20’}
[2017-11-17 10:16:18.260843] INFO: general_feature_extractor: year 2010, featurerows=431567
WARNING: unknown fields: {‘close_5close_10close_20’}
[2017-11-17 10:16:19.040919] INFO: general_feature_extractor: year 2011, featurerows=511455
WARNING: unknown fields: {‘close_5close_10close_20’}
[2017-11-17 10:16:20.965547] INFO: general_feature_extractor: year 2012, featurerows=565675
WARNING: unknown fields: {‘close_5close_10close_20’}
[2017-11-17 10:16:21.724638] INFO: general_feature_extractor: year 2013, featurerows=564168
WARNING: unknown fields: {‘close_5close_10close_20’}
[2017-11-17 10:16:23.918846] INFO: general_feature_extractor: year 2014, featurerows=569948
WARNING: unknown fields: {‘close_5close_10close_20’}

另外

Exception Traceback (most recent call last)
in ()
44 m4_1 = M.filter.v2(data=m4.data, expr=‘st_status_0 == 0’)
45 # StockRanker机器学习训练
—> 46 m5 = M.stock_ranker_train.v3(training_ds=m4_1.data, features=conf.features)
47
48

Exception: output ranker not generated
Error in training : No features available for training!

请问这是什么原因?谢谢


(iQuant) #2

你好,你是使用的可视化模式还是代码模式呢?

features = [
    'close_5'
    'close_10'
    'close_20'
     
]

features是一个列表,因子之间应该要加逗号吧?
如果还有问题,你可以加入我们的官方QQ群:537280168。


(Paracelsus) #3

是的,没有加逗号。。。
编程的新手,从头开始学,还有好多地方不太熟练~