From 201444677d6237dad188f44bbbef4d650e4cb600 Mon Sep 17 00:00:00 2001 From: paillarj Date: Mon, 14 Oct 2024 09:41:18 +0200 Subject: [PATCH] Fix doc example. Remove deprecated sklean metric --- examples/plot_diabetes_variable_importance_example.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/plot_diabetes_variable_importance_example.py b/examples/plot_diabetes_variable_importance_example.py index d195a4c..a6075b2 100644 --- a/examples/plot_diabetes_variable_importance_example.py +++ b/examples/plot_diabetes_variable_importance_example.py @@ -52,7 +52,7 @@ from sklearn.base import clone from sklearn.datasets import load_diabetes from sklearn.linear_model import RidgeCV -from sklearn.metrics import mean_squared_error, r2_score +from sklearn.metrics import r2_score, root_mean_squared_error from sklearn.model_selection import KFold from hidimstat.cpi import CPI @@ -80,7 +80,7 @@ score = r2_score( y_true=y[test_index], y_pred=regressor_list[i].predict(X[test_index]) ) - mse = mean_squared_error( + mse = root_mean_squared_error( y_true=y[test_index], y_pred=regressor_list[i].predict(X[test_index]) ) @@ -100,7 +100,7 @@ estimator=regressor_list[i], imputation_model=RidgeCV(alphas=np.logspace(-3, 3, 10)), # covariate_estimator=HistGradientBoostingRegressor(random_state=0,), - n_perm=50, + n_permutations=50, random_state=0, n_jobs=4, ) @@ -140,7 +140,7 @@ y_train, y_test = y[train_index], y[test_index] pi = PermutationImportance( estimator=regressor_list[i], - n_perm=50, + n_permutations=50, random_state=0, n_jobs=4, )