"Alternative", (tried-to-be) refactored, and (almost) functional version of code available here, which is part of article Predicting Stock Prices in 50 lines of Python, by Adesh Shah.
- Install depedencies (using pip)
pip3 install csv
pip3 install numpy
pip3 install scikit-learn
pip3 install matplotlib
- Run script
python3 stock_price_predictor.py
- Use Python 3 to run this code
- Dataset used here was from Banco do Brasil (a brazillian bank company), instead of Apple.
If you wanna use this script with another dataset, change line 63 from stock_price_predictor.py
to the name of your dataset (for instructions on how to download new dataset, please refer to cited article).
Inácio Medeiros