Skip to content

Commit

Permalink
Fix doc example. Remove deprecated sklean metric
Browse files Browse the repository at this point in the history
  • Loading branch information
paillarj committed Oct 14, 2024
1 parent 143f518 commit 2014446
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/plot_diabetes_variable_importance_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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])
)

Expand All @@ -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,
)
Expand Down Expand Up @@ -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,
)
Expand Down

0 comments on commit 2014446

Please sign in to comment.