This post is based on “How to Leverage the Pipeline to Conduct Machine Learning in the IDE” by Jim Obreen and presents a modification of Jim's notebook using previous returns as decision variables and a Gaussian Naive Bayes predictor of high and low return stocks after days to instead of Linear Regression, this algorithms is also based on the Analysis of a Naive Bayes High Low Return Predictor using Previous Returns Notebook