Skip to content

Commit

Permalink
Residuals vs Sampling example
Browse files Browse the repository at this point in the history
  • Loading branch information
achamma723 committed Jul 17, 2024
1 parent 5696f6b commit 72d5cdf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/plot_residuals_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
from sklearn.metrics import roc_auc_score
import time

n, p = (1000, 50)
n, p = (1000, 12)
inter_cor, intra_cor = (0, 0.85)
n_blocks = 1
n_signal = 20
n_signal = 2
problem_type = "regression"
snr = 4
rf = RandomForestRegressor(random_state=2023)
Expand Down Expand Up @@ -107,7 +107,7 @@ def compute_simulations(seed):
# Using the residuals
start_residuals = time.time()
bbi_residual = BlockBasedImportance(
estimator="RF",
estimator="DNN",
importance_estimator="residuals_RF",
do_hypertuning=True,
dict_hypertuning=None,
Expand All @@ -133,7 +133,7 @@ def compute_simulations(seed):
# Using the sampling RF
start_sampling = time.time()
bbi_sampling = BlockBasedImportance(
estimator="RF",
estimator="DNN",
importance_estimator="sampling_RF",
do_hypertuning=True,
dict_hypertuning=None,
Expand All @@ -160,9 +160,9 @@ def compute_simulations(seed):
return df_final


parallel = Parallel(n_jobs=10, verbose=1)
parallel = Parallel(n_jobs=2, verbose=1)
final_result = parallel(
delayed(compute_simulations)(seed=seed) for seed in np.arange(1, 101)
delayed(compute_simulations)(seed=seed) for seed in np.arange(1, 11)
)

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

0 comments on commit 72d5cdf

Please sign in to comment.