July 2019
Beginner to intermediate
740 pages
16h 52m
English
Let's see whether the ARIMA model or the linear regression model performed better at predicting Netflix closing prices in January 2019 by gathering new data and using the prediction methods in the StockModeler class:
>>> import datetime>>> start = datetime.date(2019, 1, 1)>>> end = datetime.date(2019, 1, 31)>>> jan_2019 = stock_analysis.StockReader(... start, end... ).get_ticker_data('NFLX')>>> fig, axes = plt.subplots(1, 2, figsize=(15, 5))>>> arima_ax = StockModeler.arima_predictions(... nflx, arima_model, start=start, end=end, ... ax=axes[0], title='ARIMA'... )>>> jan_2019.close.plot(... ax=arima_ax, style='b:', label='actual close'... )>>> arima_ax.legend()>>> arima_ax.set_ylabel('price ($)')
>>> linear_reg = StockModeler.regression_predictions( ...
Read now
Unlock full access