Predicting Stock Trades with Machine Learning

I decided to select my stock prediction problem with the goal of reducing the complexity of the problem while achieving a useful result. I defined my problem (to solve with machine learning (ML)) as predicting whether WMT would be a good buy/sell within the next D days. A good buy/sell was a change in stock price of P percent.

I used 38 custom features related to technical stock analysis such as momentum and stochastic indicators, and 14 years of stock data from the Quandl API.

Only k Nearest Neighbors (kNN), random forests, and multi-layer perceptron (neural networks) performed better than random choice with kNN having the best accuracy and precision. The other models seemed to have performed poorly due to their inability to provide mappings that are complex enough or due to relying on invalid assumptions. Dimensionality reduction did not produce usable results for any of the methods that I tested.