I am currently working through the book : An Introduction to Statistical Learning with Applications in Python. In the exercises so far I have been using the ISLP package.
I am currently trying to solve the exercises from Chapter 6 and I am stuck at question 8 part (d).
Forward selection works as shown in the labs. But I am unable to use the ISLP package to perform backward selection. Even after reading the documentation here I am unable to solve this problem. Trying to perform backward selection results in a model without any coefficients / type errors.
I will attach my code below and will appreciate it a lot if you could help me out.
Backward Stepwsie Selection with first_peak
I understand that Stepwise.first_peak is a method used for forward selection and I tried to perform backward selection using just Stepwise. This results in the following error. Using Stepwise.fixed_steps results in something similar.