There appears to be an error with the backward selection algorithm?
While
strategy = Stepwise.first_peak(design,
direction='forward',
max_terms=len(design.terms))
df_Cp = sklearn_selected(OLS,
strategy,
scoring=neg_Cp)
df_Cp.fit(Hitters, Y)
print(df_Cp.selected_state_)
works fine and results in
('Assists', 'AtBat', 'CAtBat', 'CRBI', 'CRuns', 'CWalks', 'Division', 'Hits', 'PutOuts', 'Walks')
If I change the algorithm to 'backward' I get an empty set:
strategy = Stepwise.first_peak(design,
direction='backward',
max_terms=len(design.terms))
df_Cp = sklearn_selected(OLS,
strategy,
scoring=neg_Cp)
df_Cp.fit(Hitters, Y)
print(df_Cp.selected_state_)
results in empty selections
Since I get similar outcomes with other data sets, I have a suspicion that the 'backward' method is not implemented correctly?
I also noticed that the wrapper does not warn the user when typing a keyword different from 'forward', 'backward' or 'both' and seems to simply revert to 'forward' as the standard method.
There appears to be an error with the backward selection algorithm?
While
works fine and results in
If I change the algorithm to 'backward' I get an empty set:
results in empty selections
Since I get similar outcomes with other data sets, I have a suspicion that the 'backward' method is not implemented correctly?
I also noticed that the wrapper does not warn the user when typing a keyword different from 'forward', 'backward' or 'both' and seems to simply revert to 'forward' as the standard method.