From f0ed2f277834d9ec960522c5a181ac37069ff615 Mon Sep 17 00:00:00 2001 From: jwaton Date: Fri, 21 Dec 2018 14:23:01 +0000 Subject: [PATCH 1/2] Typo fix in readme: 'complentairy pairs' -> 'complementary pairs' --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 8b070e8cf41c269820d910a04dcdd3aee5c0e1d7 Mon Sep 17 00:00:00 2001 From: jwaton Date: Fri, 21 Dec 2018 14:27:45 +0000 Subject: [PATCH 2/2] Add condition to only plot non-highlighted paths in the case there are some to plot --- stability_selection/stability_selection.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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,