Before we start applying machine learning techniques to build predictive models, we need to perform some exploratory data wrangling on our dataset with the help of the steps listed here. This is often a large and an underestimated prerequisite when it comes to applying advanced methods to financial datasets.
- Getting the data: We'll continue to use Google stock data that we've used in our previous chapter:
import pandas as pdfrom pandas_datareader import datadef load_financial_data(start_date, end_date, output_file): try: df = pd.read_pickle(output_file) print('File data found...reading GOOG data') except FileNotFoundError: print('File not found...downloading the GOOG data') df = data.DataReader('GOOG', 'yahoo', ...