EpistasisLab / EpistasisLab/tpot

Mapping features with feature importances after StackingEstimator

Open
#1,174 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Jupyter Notebook
Stars
10.1k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

I would like to understand, how to map my features with their importances after the following pipeline (I got 3 features more after the training). Below is my pipeline:

StandardScaler(),
StackingEstimator(estimator=RandomForestClassifier(bootstrap=True, criterion="entropy", max_features=0.6000000000000001, min_samples_leaf=14, min_samples_split=10, n_estimators=100)),
XGBClassifier(learning_rate=0.001, max_depth=9, min_child_weight=7, n_estimators=100, n_jobs=1, subsample=0.3, verbosity=0)

Similar issue:
`StackingEstimator` in 1st step should add one synthetic feature to left of the input features and the synthetic feature is the prediction of nested estimator `RandomForestRegressor(bootstrap=True, max_features=0.05, min_samples_leaf=19, min_samples_split=12, n_estimators=100)`. So the return array from `tpot._fitted_pipeline.steps[-1][1].feature_importances_` has one item longer than the original list of features.

_Originally posted by @weixuanfu in https://github.com/EpistasisLab/tpot/issues/749#issuecomment-416956692_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.