Implementing the revised approach
In this section, we will discuss the three parts of implementation, which are as follows:
Implementation
Testing the revised approach
Understanding the problem with the revised approach
Implementation
Here, we are implementing the following:
Alignment
Smoothing
Logistic Regression
We have already discussed the approach and key concepts, so now we just focus on the code part here. You can find all the code at this GitHub link: https://github.com/jalajthanaki/stock_price_prediction/blob/master/Stock_Price_Prediction.ipynb.
Implementing alignment
The alignment is performed on the testing dataset. You can refer to the following code snippet:
As you can see in the preceding code snippet, we obtain a difference of 10 days adj close price using the average price of the last 5 days and the average price of the predicted upcoming 5 days in order to align the test data. Here, we also convert the date from the string into...