Commit b1c1d69f authored by Dr.李's avatar Dr.李

update examples

parent e25eb965
......@@ -48,10 +48,9 @@ Model phase: we need 1 constant linear model and one linear regression model
"""
alpha_name = ['alpha_factor']
#const_features = {alpha_name[0]: LAST('optimism_confidence_25d') + LAST('pessimism_confidence_25d')}
# const_features = {alpha_name[0]: CSRes(DIFF(1. / LAST('PE')), LAST('roe_q'))}
simple_expression = LAST('cfinc1_q') # CSRes(CSRes(LAST('DividendPS'), LAST('roe_q')), LAST('ep_q'))
base1 = LAST('roe_q')
base2 = CSRes(LAST('ep_q'), 'roe_q')
simple_expression = CSRes(CSRes(LAST('DividendPS'), base1), base2)
const_features = {alpha_name[0]: simple_expression}
const_weights = np.array([1.])
......
......@@ -75,14 +75,14 @@ def factor_residue_analysis(start_date,
engine = SqlEngine()
# df = engine.fetch_factor_coverage().groupby('factor').mean()
# df = df[df.coverage >= 0.98]
df = engine.fetch_factor_coverage().groupby('factor').mean()
df = df[df.coverage >= 0.98]
universe = Universe('custom', ['zz800'])
factor_df = pd.DataFrame()
for i, factor in enumerate(['EGRO']):
res = factor_residue_analysis('2012-01-01',
for i, factor in enumerate(df.index):
res = factor_residue_analysis('2011-01-01',
'2018-01-05',
factor,
'5b',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment