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 ...@@ -48,10 +48,9 @@ Model phase: we need 1 constant linear model and one linear regression model
""" """
alpha_name = ['alpha_factor'] alpha_name = ['alpha_factor']
#const_features = {alpha_name[0]: LAST('optimism_confidence_25d') + LAST('pessimism_confidence_25d')} base1 = LAST('roe_q')
# const_features = {alpha_name[0]: CSRes(DIFF(1. / LAST('PE')), LAST('roe_q'))} base2 = CSRes(LAST('ep_q'), 'roe_q')
simple_expression = CSRes(CSRes(LAST('DividendPS'), base1), base2)
simple_expression = LAST('cfinc1_q') # CSRes(CSRes(LAST('DividendPS'), LAST('roe_q')), LAST('ep_q'))
const_features = {alpha_name[0]: simple_expression} const_features = {alpha_name[0]: simple_expression}
const_weights = np.array([1.]) const_weights = np.array([1.])
......
...@@ -75,14 +75,14 @@ def factor_residue_analysis(start_date, ...@@ -75,14 +75,14 @@ def factor_residue_analysis(start_date,
engine = SqlEngine() engine = SqlEngine()
# df = engine.fetch_factor_coverage().groupby('factor').mean() df = engine.fetch_factor_coverage().groupby('factor').mean()
# df = df[df.coverage >= 0.98] df = df[df.coverage >= 0.98]
universe = Universe('custom', ['zz800']) universe = Universe('custom', ['zz800'])
factor_df = pd.DataFrame() factor_df = pd.DataFrame()
for i, factor in enumerate(['EGRO']): for i, factor in enumerate(df.index):
res = factor_residue_analysis('2012-01-01', res = factor_residue_analysis('2011-01-01',
'2018-01-05', '2018-01-05',
factor, factor,
'5b', '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