I am running the notebook
I ran file 05 and 06 to create predictions.h5, but can not find code which write train/1
to it
def load_predictions(bundle):
t = 1
df = pd.concat([pd.read_hdf(results_path / 'predictions.h5', 'train/{:02}'.format(t)), # missing train/1 key
pd.read_hdf(results_path / 'predictions.h5', 'test/{:02}'.format(t))])
df = df[~df.index.duplicated()].drop('y_test', axis=1)
predictions = df.iloc[:, :5].mean(1).to_frame('predictions')
tickers = predictions.index.get_level_values('ticker').unique().tolist()
assets = bundle.asset_finder.lookup_symbols(tickers, as_of_date=None)
predicted_sids = pd.Int64Index([asset.sid for asset in assets])
ticker_map = dict(zip(tickers, predicted_sids))
return (predictions
.unstack('ticker')
.rename(columns=ticker_map)
.predictions
.tz_localize('UTC')), assets
Anyone can help ?