def recurvise_index(self, clf,):
# rank all features, i.e continue the elimination until the last one
rfe = RFE(clf, n_features_to_select=1)
rfe.fit(self.features, self.labels)
# map recursive feature score to the feature names
rfedict = {k: v for k, v in
zip(self.features.columns.tolist(),
map(lambda x: round(x, 4),
rfe.ranking_
)
)
}
return rfedict
评论列表
文章目录