How to select features based on feature importance using SelectFromModel?
The error is related to this line:

 selection = SelectFromModel(rg_cv, threshold=thresh, prefit=True)


It should be modified as follows:

print("Tuned rf best params: {}".format(rg_cv.best_params_))
be=rg_cv.best_estimator_
best=be.fit(X_train,y_train)
thresholds = np.sort(rg_cv.best_estimator_.named_steps["clf"].feature_importances_)
for thresh in thresholds:
    # select features using threshold
    selection = SelectFromModel(be.steps [1][1], threshold=thresh, prefit=True)