scorer = check_scoring(estimator, scoring=scoring)
baseline_score = scorer(estimator, X, y)
scores = np.zeros((X.shape[1], n_repeats))
scores = Parallel(n_jobs=n_jobs)(delayed(_calculate_permutation_scores)(
estimator, X, y, col_idx, random_state, n_repeats, scorer
) for col_idx in range(X.shape[1]))
After Change
// the fact that variables are shared or not depending on the active
// joblib backend (sequential, thread-based or process-based).
random_state = check_random_state(random_state)
random_seed = random_state.randint(np.iinfo(np.int32).max + 1)
scorer = check_scoring(estimator, scoring=scoring)
baseline_score = scorer(estimator, X, y)