feature-selector icon indicating copy to clipboard operation
feature-selector copied to clipboard

model.feature_importances_ don't change ...

Open psaks opened this issue 5 years ago • 0 comments

It doesn't seem that feature importances change. Using "lightgbm==2.3.0" I get the following;

`xval, yval = make_classification(n_samples = 1000, n_features=10) model = lgb.LGBMClassifier(n_estimators=100, learning_rate = 0.05, verbose = -1)

for i in range(10): model.fit(xval, yval) print(model.feature_importances_) [244 537 213 214 183 222 282 264 175 648] [244 537 213 214 183 222 282 264 175 648] [244 537 213 214 183 222 282 264 175 648] [244 537 213 214 183 222 282 264 175 648] [244 537 213 214 183 222 282 264 175 648] [244 537 213 214 183 222 282 264 175 648] [244 537 213 214 183 222 282 264 175 648] [244 537 213 214 183 222 282 264 175 648] [244 537 213 214 183 222 282 264 175 648] [244 537 213 214 183 222 282 264 175 648]`

If this is "correct" LightGBM behaviour, then there is obviously no need to average the feature_importances_ over multiple iterations.

psaks avatar Nov 23 '19 10:11 psaks