Skip to content

Commit 49c86ac

Browse files
author
minjk-bl
committed
Fix create permutation code
1 parent e742830 commit 49c86ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

visualpython/python/userCommand.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def vp_create_permutation_importances(model, X_train, y_train, scoring=None, sor
130130
if isinstance(X_train, _vp_pd.core.frame.DataFrame):
131131
feature_names = X_train.columns
132132
else:
133-
feature_names = [ 'X{}'.format(i) for i in range(len(model.feature_importances_)) ]
133+
feature_names = [ 'X{}'.format(i) for i in range(X_train.shape[1]) ]
134134

135135
imp = permutation_importance(model, X_train, y_train, scoring=scoring)
136136

0 commit comments

Comments
 (0)