Exploring problems with the existing approach
In this section, we will be discussing the problems of the existing approach. There are mainly three errors we could have possibly committed, which are listed as follows:
- Alignment
- Smoothing
- Trying a different ML algorithm
Let's discuss each of the points one by one.
Alignment
As we have seen in the graph, our actual price and predicted prices are not aligned with each other. This becomes a problem. We need to perform alignment on the price of the stocks. We need to consider the average value of our dataset, and based on that, we will generate the alignment. You can understand more about alignment in upcoming section called Alignment-based approach.
Smoothing
The second problem I feel we have with our first model is that we haven't applied any smoothing techniques. So for our model, we need to apply smoothing techniques as well. We will be using the Exponentially Weighted Moving Average (EWMA) technique for smoothing. This technique is used to adjust the variance of the dataset.
Trying a different ML algorithm
For our model, we have used the RandomForestRegressor
algorithm. But what if we try the same thing with our model using a different algorithm, say Logistic Regression? In the next section, you will learn how to implement this algorithm—after applying the necessary alignment and smoothing, of course.
We have seen the possible problems with our first baseline approach. Now, we will try to understand the approach for implementing the alignment, smoothing, and Logistic Regression
algorithms.