Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error During save_predictions #39

Open
minger88 opened this issue Jul 21, 2020 · 2 comments
Open

Error During save_predictions #39

minger88 opened this issue Jul 21, 2020 · 2 comments
Assignees
Labels

Comments

@minger88
Copy link

Describe the bug
Attempting to run the MarketFlow tutorial, the code throws an error after plot generation, during what seems like its attempt to write the data.

To Reproduce
Steps to reproduce the behavior:

  1. ~> mflow --train 2019-01-01
  2. ~> mflow --predict 2020-07-21

both train and predict flags seem to exit at the same place.

Expected behavior
I expected the code to finish and write out the file to the ./output/ directory

Desktop (please complete the following information):

  • OS: Linux Mint 18.3
  • Python: v3.7.7

Traceback
[07/20/20 21:06:02] INFO Writing feature map to ./model/feature_map_20200720.pkl
[07/20/20 21:06:02] INFO Loading data from ./input/test_20200720.csv
Traceback (most recent call last):
File "/home/michael/miniconda3/bin/mflow", line 8, in
sys.exit(main())
File "/home/michael/miniconda3/lib/python3.7/site-packages/alphapy/market_flow.py", line 430, in main
model = market_pipeline(model, market_specs)
File "/home/michael/miniconda3/lib/python3.7/site-packages/alphapy/market_flow.py", line 292, in market_pipeline
run_analysis(a, lag_period, forecast_period, leaders, predict_history)
File "/home/michael/miniconda3/lib/python3.7/site-packages/alphapy/analysis.py", line 270, in run_analysis
analysis.model = main_pipeline(model)
File "/home/michael/miniconda3/lib/python3.7/site-packages/alphapy/main.py", line 426, in main_pipeline
model = training_pipeline(model)
File "/home/michael/miniconda3/lib/python3.7/site-packages/alphapy/main.py", line 289, in training_pipeline
save_model(model, 'BEST', Partition.test)
File "/home/michael/miniconda3/lib/python3.7/site-packages/alphapy/model.py", line 1315, in save_model
preds, probas = save_predictions(model, tag, partition)
File "/home/michael/miniconda3/lib/python3.7/site-packages/alphapy/model.py", line 1208, in save_predictions
pd_indices = pf[pf.date >= predict_date].index.tolist()
File "/home/michael/miniconda3/lib/python3.7/site-packages/pandas/core/generic.py", line 5274, in getattr
return object.getattribute(self, name)
AttributeError: 'DataFrame' object has no attribute 'date'

@mrconway mrconway self-assigned this Aug 25, 2020
@mrconway mrconway added the bug label Aug 25, 2020
@AlexVaPe
Copy link

Hi,
I'm having the same issue and don't know how to run the tutorial example. Is there any solution to this bug?

Thanks

@AlexVaPe
Copy link

Hi,
I'm having the same issue and don't know how to run the tutorial example. Is there any solution to this bug?

Thanks

I've found that the issue was in model.yml file, on line 8, as it drops the date column, so you have to avoid deleting it and it will not show any error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants