From 8e7d3ca756e82b3915fd3bf673fde93520725e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gy=C3=B6rgy=20Kov=C3=A1cs?= Date: Sun, 21 Aug 2022 13:22:29 +0200 Subject: [PATCH] typo bugfix --- smote_variants/_version.py | 2 +- smote_variants/base/_simplexsampling.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/smote_variants/_version.py b/smote_variants/_version.py index daf748c..a69a730 100755 --- a/smote_variants/_version.py +++ b/smote_variants/_version.py @@ -6,4 +6,4 @@ @author: gykovacs """ -__version__= '0.6.7' +__version__= '0.6.8' diff --git a/smote_variants/base/_simplexsampling.py b/smote_variants/base/_simplexsampling.py index 1bf9f76..82369a0 100644 --- a/smote_variants/base/_simplexsampling.py +++ b/smote_variants/base/_simplexsampling.py @@ -492,9 +492,12 @@ def simplices(self, n_to_sample, p=weights/np.sum(weights)) elif self.simplex_sampling == 'deterministic': - selected_simplices = deterministic_sample(choices, - n_to_sample, - p=weights/np.sum(weights)) + selected_indices = deterministic_sample(choices, + n_to_sample, + p=weights/np.sum(weights)) + else: + raise ValueError(f"no such simplex sampling strategy: {self.simplex_sampling}") + return all_simplices[selected_indices] def add_gaussian_noise(self, samples):