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

Forecasting Menu [Work in Progress] #1933

Merged
merged 515 commits into from
Oct 8, 2022
Merged

Forecasting Menu [Work in Progress] #1933

merged 515 commits into from
Oct 8, 2022

Conversation

martinb-ai
Copy link
Contributor

@martinb-ai martinb-ai commented Jun 13, 2022

Description

  • Forecasting menu option
  • Forecasting Controller/model/view
  • Show dataset
  • Plot dataset
  • Combine dataset
  • Delete dataset column
  • Rename dataset column
  • Load dataset
  • Probabilistic Exponential Smoothing model
  • Theta model
  • Probabilistic Recurrent Neural Network (RNN, LSTM, GRU)
  • Block Recurrent Neural Network (RNN, LSTM, GRU) (feat. Past covariates)
  • Neural Bayesian Estimation (feat. Past covariates)
  • Temporal Convolutional Neural Network (feat. Past covariates)
  • Dataset cleaning
  • Dataset descriptive statistics
  • Feature engineering menu option
  • EMA
  • Stochastic Oscillator
  • RSI
  • ROC
  • Momentum
  • % Delta change
  • Average true range
  • simple moving average short/long window
  • price signal
  • Refresh loaded dataset on menu
  • Regression model (@colin99d )
  • Transformer model (@colin99d - not temporal)
  • Temporal Fusion transformer (performs weirdly)
  • Display user compute device (CPU vs. GPU)
  • Display user torch and darts version
  • Port over Arima (non torch) (@colin99d ) (Hide for now)
  • Port over knn (non torch) (@colin99d )
  • Port over MonteCarlo (non torch) (@colin99d)
  • Linear Regression (@colin99d )
  • Plot seasonality of data (@colin99d this technically "works" but graph looks terrible, reached out to @piiq )
  • Plot residuals from best_model (flag to set before training) (plot_residuals_analysis()) (@colin99d) --> Theta model does not work - make theta just print out that its not available. Also, theme needs a few tweaks. (@colin99d )
  • Plot dataset feature correlation coefficients
  • Pytest - Just make it run and successfully train (@colin99d )
  • Base class/ refactoring (@colin99d + @martinb-bb ) - 69.420% done for now...
  • Get rid of this printout:
    [2022-06-16 14:43:03,449] WARNING | darts.models | Support for AutoARIMA, BATS and TBATS is not available.To enable it, install u8darts[pmdarima] or u8darts[all]. [2022-06-16 14:43:03,450] WARNING | darts.models | Support for Facebook Prophet is not available. To enable it, install "darts", "u8darts[prophet]" or "u8darts[all]" (with pip);or "u8darts-all" (with conda). (fixed with PR Opt-out of darts logging based on environment variable unit8co/darts#1010)
  • Remove external_axis from the docstrings or use the argument(@colin99d)
  • Glossary (@colin99d) (dict)
  • Confirm features work with Polygon and cryptodata (@colin99d)
  • Check if ram requirements match data size
  • plot only historical forecast (not entire series) (@colin99d)
  • Develop API (@colin99d)
  • Remove pred menus from the terminal (@colin99d )
  • Remove Tensorflow requirements (@colin99d )
  • Allow to bring any data from another menu to forecasting directly stocks/load AAPL/forecast/USE MODEL - works for both stocks and crypto menu. - to add economy soon or in V2
  • grab exported data from EXPORT folder as well (@colin99d)
  • standarize all models/views for ease of use in API
  • load mutliple stocks from stocks menu
  • Give combine warnings if it needs to use index
  • Add --all-covariates flag
  • Naive Bayes (for setting baseline)
  • If someone doesn't specify combine columns combine all columns
  • Rename menu to forecast
  • Make the disclaimer when we boot up terminal
  • Handle no darts gracefully
  • Fix hard-coded export path (this looks like a Darren specific issue)
  • Do not format non dollar amounts as dollar amounts
  • Standardize names in columns (default string for ticker)
  • Have a better way of handling target column not working

Other Bugs Fixed:

Checklist:

Known issues

Screen Shot 2022-07-21 at 7 22 40 PM

V2 Features:

  • Bring in Darts Datasets for further user experimentation
  • Plot data in different ways (bar chart, box and whisker, 3D???)
  • multi input and 2 y axis plotting ( economy menu)
  • Static covariates
  • stochastic forecasts capturing model uncertainty using Monte Carlo Dropout with deep learning models
  • Load previously trained models for inference
  • Train OpenBB NN model for off-the-shelf forecasting ( Long term goal))
  • past covariates with different delta T
  • Create a dashboard
  • encoding string variables in columns
  • hyperparameter tuning with Raytune: https://docs.ray.io/en/latest/tune/examples/tune-pytorch-lightning.html
  • Do a better job at merging dataframes with different times (Polygon data can be 4 hours off)
  • Refactor the views to use all the same code
  • More descriptive feature engineering names (running the same feat eng on different columns replaces old values)

Others

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My code passes all the checks pylint, flake8, black, ... To speed up development you should run pre-commit install.
  • New and existing unit tests pass locally with my changes. You can test this locally using pytest tests/....

To use in Jupyter:
from openbb_terminal.api import forecast as fc
from openbb_terminal import api

import matplotlib.pyplot as plt
import matplotlib_inline.backend_inline

%matplotlib inline
matplotlib_inline.backend_inline.set_matplotlib_formats("svg")
api.theme.applyMPLstyle()

@martinb-ai martinb-ai added the feat XL Extra Large feature label Jun 13, 2022
@martinb-ai martinb-ai self-assigned this Jun 13, 2022
@DidierRLopes
Copy link
Collaborator

Someone has been avoiding sleep 👀

@jmaslek
Copy link
Collaborator

jmaslek commented Jun 15, 2022

This is looking awesome. Small point I'm noticing. For controllers/argparse choices, y'all are doing --some_thing.

We should stick to doing --some-thing

@martinb-ai
Copy link
Contributor Author

Gotcha, will update!

@martinb-ai martinb-ai marked this pull request as draft June 16, 2022 12:10
@colin99d colin99d changed the title ML Forecasting menu [Work in progress] Scope Creep (Aka ML/AI Menu) Jun 20, 2022
@colin99d colin99d changed the title Scope Creep (Aka ML/AI Menu) Forecasting Menu [Work in Progress] Jun 20, 2022
Copy link
Contributor

@piiq piiq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have predict menu leftovers here and there, is it supposed to be like that?

image

image

image

image

openbb_terminal/api.py Outdated Show resolved Hide resolved
openbb_terminal/dashboards/stream/forecast.py Show resolved Hide resolved
Copy link
Contributor

@piiq piiq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LFGO 🚀

Copy link
Collaborator

@jmaslek jmaslek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to join in on the fun

@colin99d colin99d merged commit 7fd72d9 into OpenBB-finance:main Oct 8, 2022
@piiq piiq mentioned this pull request Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment