Nested ML with hyperparameters tuning

I was based on the solution proposed in the question below: