Skip to content

Commit

Permalink
renamed feature_importances variable in extract_feature_importance
Browse files Browse the repository at this point in the history
  • Loading branch information
Adeemy committed Jun 2, 2024
1 parent 3c4b07e commit e845574
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/training/utils/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,20 +555,20 @@ def extract_feature_importance(
# this if statement is needed to LR coefficients instead.
classifier_name = pipeline.named_steps["classifier"].__class__.__name__
if classifier_name == "LogisticRegression":
feature_importance_scores = pipeline.named_steps["classifier"].coef_[0]
feature_importances = pipeline.named_steps["classifier"].coef_[0]

if classifier_name not in [
"LogisticRegression",
"VotingClassifier",
]:
feature_importance_scores = pipeline.named_steps[
feature_importances = pipeline.named_steps[
"classifier"
].feature_importances_

if classifier_name != "VotingClassifier":
self._log_feature_importance_fig(
classifier_name=classifier_name,
feature_importance_scores=feature_importance_scores,
feature_importance_scores=feature_importances,
col_names=col_names,
n_top_features=n_top_features,
figure_size=figure_size,
Expand Down

0 comments on commit e845574

Please sign in to comment.