From the course: Practical Python for Algorithmic Trading

Unlock the full course today

Join today to access over 23,400 courses taught by industry experts.

Walk forward validation in machine learning

Walk forward validation in machine learning - Python Tutorial

From the course: Practical Python for Algorithmic Trading

Walk forward validation in machine learning

- [Instructor] Let's imagine for a second that we have a data set whose rows start at the beginning of 2016 and they finish at the end of 2022, which are the different algorithms that we can use to evaluate our investment strategy? In previous tutorials we covered the train test split where we choose a splitting point to separate the data between the training set, the blue area, and the test set, the yellow area, based on all the time range. In this tutorial we are introducing the walk-forward validation, both anchored and unanchored. The walk-forward divides the data in a specific number of splits. In this example is five, and you can see that for the anchored walk-forward the first split we separate the data at the end of 2017 and take 2018 as the validation set to evaluate our investment strategy. As you may observe we get an error of 9.4, and in the third split to validate for 2020 we get 33 as the error, which is…

Contents