0

I'm trying to pair RFECV with permutation importance. I would like to use the non-cv version of the permutation importance computation. I tried several approaches but I get always a NotFittedError for the estimator_func while trying to fit the rfecv. Am I missing something? PermutationImportance is from Eli5 since the sklearn version doesn't provide feature importance.

When I pair RFECV with CV- PermutationImportance, everything works fine, but I would like to have the non-cv version.

estimator_funct = estimator_funct.fit(extract_relevant_features, choosen_target)

pi = PermutationImportance(estimator_funct,  scoring='r2', n_iter=10, random_state=1).fit(extract_relevant_features, choosen_target)

rfecv = RFECV(
 estimator=pi,
 step=1,
 cv=cv_func,
 scoring=score,
 min_features_to_select=min_features_to_select,
)

rfecv.fit(extract_relevant_features,
       choosen_target,
       groups=extract_relevant_features.index) 
desertnaut
  • 57,590
  • 26
  • 140
  • 166
Enes
  • 33
  • 1
  • 4

0 Answers0