mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
fix: logical error
Fix logical error in the conditional checks for model classes. The `elif` statement that looks for "lightgbm.sklearn" or "xgb" in the model class string is now broken into two separate conditions because the old condition would always evaluate to `True` due to the non-empty string "xgb".
This commit is contained in:
@@ -118,10 +118,12 @@ def plot_feature_importance(model: Any, pair: str, dk: FreqaiDataKitchen,
|
|||||||
mdl = models[label]
|
mdl = models[label]
|
||||||
if "catboost.core" in str(mdl.__class__):
|
if "catboost.core" in str(mdl.__class__):
|
||||||
feature_importance = mdl.get_feature_importance()
|
feature_importance = mdl.get_feature_importance()
|
||||||
elif "lightgbm.sklearn" or "xgb" in str(mdl.__class__):
|
elif "lightgbm.sklearn" in str(mdl.__class__):
|
||||||
|
feature_importance = mdl.feature_importances_
|
||||||
|
elif "xgb" in str(mdl.__class__):
|
||||||
feature_importance = mdl.feature_importances_
|
feature_importance = mdl.feature_importances_
|
||||||
else:
|
else:
|
||||||
logger.info('Model type not support for generating feature importances.')
|
logger.info('Model type does not support for generating feature importances.')
|
||||||
return
|
return
|
||||||
|
|
||||||
# Data preparation
|
# Data preparation
|
||||||
|
|||||||
Reference in New Issue
Block a user