Created
September 15, 2018 05:02
-
-
Save srishtis/b573223c4db3bfd88b98b744c2256220 to your computer and use it in GitHub Desktop.
LGBM for importance type 'gain'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LGBMClassifier_GainFE(lgb.LGBMClassifier): | |
@property | |
def feature_importances_(self): | |
if self._n_features is None: | |
raise LGBMNotFittedError('No feature_importances found. Need to call fit beforehand.') | |
return self.booster_.feature_importance(importance_type='gain') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment