You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`from spectre.data import ArrowLoader
import torch
from spectre.factors import *
from spectre.factors.basic import *
loader = ArrowLoader('./Ashare.feather')
engine = FactorEngine(loader)
if torch.cuda.is_available():
print("GPU is available.")
engine.to_cuda()
else:
print("GPU is not available.")
engine.to_cpu()
请教,针对A股运行如下代码
`from spectre.data import ArrowLoader
import torch
from spectre.factors import *
from spectre.factors.basic import *
loader = ArrowLoader('./Ashare.feather')
engine = FactorEngine(loader)
if torch.cuda.is_available():
print("GPU is available.")
engine.to_cuda()
else:
print("GPU is not available.")
engine.to_cpu()
universe = StaticAssets({'SZ002880','SH600030'}) # 5.29日SZ002880停牌
engine.set_filter(universe) # 设置股池
engine.add(RankFactor(inputs=[OHLCV.close]), 'RankFactor')
all_factors = engine.run("2023-5-25", "2023-5-29")
print(all_factors)
输出`结果如下,29号SZ002880停牌,所以只有SH600030,期望其排序值为1,为啥输出的是2呢?
RankFactor
date asset
2023-05-26 00:00:00+00:00 SH600030 2.0
SZ002880 1.0
2023-05-29 00:00:00+00:00 SH600030 2.0
The text was updated successfully, but these errors were encountered: