diff --git a/README.md b/README.md index eb7a797..e4319cf 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ print(selector.get_support(indices=True)) ### Bootstrapping strategies -`stability-selection` uses bootstrapping without replacement by default (as proposed in the original paper), but does support different bootstrapping strategies. [Shah and Samworth] proposed *complentairy pairs* bootstrapping, where the data set is bootstrapped in pairs, such that the intersection is empty but the union equals the original data set. `StabilitySelection` supports this through the `bootstrap_func` parameter. +`stability-selection` uses bootstrapping without replacement by default (as proposed in the original paper), but does support different bootstrapping strategies. [Shah and Samworth] proposed *complementary pairs* bootstrapping, where the data set is bootstrapped in pairs, such that the intersection is empty but the union equals the original data set. `StabilitySelection` supports this through the `bootstrap_func` parameter. This parameter can be: - A string, which must be one of diff --git a/stability_selection/stability_selection.py b/stability_selection/stability_selection.py index f0d8ab8..0c7ea97 100644 --- a/stability_selection/stability_selection.py +++ b/stability_selection/stability_selection.py @@ -136,8 +136,9 @@ def plot_stability_path(stability_selection, threshold_highlight=None, x_grid = stability_selection.lambda_grid / np.max(stability_selection.lambda_grid) fig, ax = plt.subplots(1, 1, **kwargs) - ax.plot(x_grid, stability_selection.stability_scores_[~paths_to_highlight].T, - 'k:', linewidth=0.5) + if not paths_to_highlight.all(): + ax.plot(x_grid, stability_selection.stability_scores_[~paths_to_highlight].T, + 'k:', linewidth=0.5) if paths_to_highlight.any(): ax.plot(x_grid, stability_selection.stability_scores_[paths_to_highlight].T,