Skip to content

Commit

Permalink
remove functional implem in example
Browse files Browse the repository at this point in the history
  • Loading branch information
jpaillard committed Feb 17, 2025
1 parent e90913c commit 8286f53
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions examples/plot_diabetes_variable_importance_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
from sklearn.metrics import r2_score, root_mean_squared_error
from sklearn.model_selection import KFold

from hidimstat import CPI, LOCO, permutation_importance
from hidimstat import CPI, LOCO, PermutationImportance

#############################################################################
# Load the diabetes dataset
Expand Down Expand Up @@ -157,15 +157,14 @@
print(f"Fold {i}")
X_train, X_test = X[train_index], X[test_index]
y_train, y_test = y[train_index], y[test_index]
importance, list_loss_j, loss_reference = permutation_importance(
X_test,
y_test,
pi = PermutationImportance(
estimator=regressor_list[i],
n_permutations=50,
random_state=0,
n_jobs=4,
)
pi_importance_list.append({"importance": importance})
importance = pi.score(X_test, y_test)
pi_importance_list.append(importance)


#############################################################################
Expand Down

0 comments on commit 8286f53

Please sign in to comment.