diff --git a/smote_variants/_version.py b/smote_variants/_version.py index a69a730..2b6a558 100755 --- a/smote_variants/_version.py +++ b/smote_variants/_version.py @@ -6,4 +6,4 @@ @author: gykovacs """ -__version__= '0.6.8' +__version__= '0.6.9' diff --git a/smote_variants/base/_oversampling.py b/smote_variants/base/_oversampling.py index 9c53b10..b07dc1f 100755 --- a/smote_variants/base/_oversampling.py +++ b/smote_variants/base/_oversampling.py @@ -348,7 +348,7 @@ class OverSamplingSimplex(OverSamplingBase, SimplexSamplingMixin): def __init__(self, *, n_dim=2, - simplex_sampling='uniform', + simplex_sampling='random', within_simplex_sampling='random', gaussian_component=None, random_state=None, diff --git a/smote_variants/base/_simplexsampling.py b/smote_variants/base/_simplexsampling.py index 82369a0..5a58319 100644 --- a/smote_variants/base/_simplexsampling.py +++ b/smote_variants/base/_simplexsampling.py @@ -336,7 +336,7 @@ class SimplexSamplingMixin(RandomStateMixin): def __init__(self, *, n_dim=2, - simplex_sampling='uniform', + simplex_sampling='random', within_simplex_sampling='deterministic', gaussian_component=None, random_state=None): @@ -347,7 +347,7 @@ def __init__(self, n_dim (int): the dimensions of the simplices (2 for line segments) simplex_sampling (str): simplex sampling method - ('uniform'/'volume'/None) + ('random'/'volume'/'deterministic'/None) within_simplex_sampling (str): within simplex sampling method ('random'/'deterministic') """ @@ -385,11 +385,11 @@ def determine_simplex_distribution(self, X, simplices): Returns: np.array: the distribution for sampling the simplices """ - if self.simplex_sampling == 'uniform': + if self.simplex_sampling in ['random', 'deterministic']: return np.repeat(1.0/len(simplices), len(simplices)) if self.simplex_sampling == 'volume': return simplex_volumes(X[simplices]) - raise ValueError(f"simplex sampling with weighting"\ + raise ValueError(f"simplex sampling with weighting "\ f"{self.simplex_sampling} not implemented yet") def all_simplices_node_weights(self, indices, simplex_weights, n_dim): @@ -486,7 +486,7 @@ def simplices(self, choices = np.arange(all_simplices.shape[0]) - if self.simplex_sampling == 'random': + if self.simplex_sampling != 'deterministic': # sample the simplices selected_indices = self.random_state.choice(choices, n_to_sample, diff --git a/smote_variants/oversampling/_a_suwo.py b/smote_variants/oversampling/_a_suwo.py index 67dea8c..d9bb01a 100755 --- a/smote_variants/oversampling/_a_suwo.py +++ b/smote_variants/oversampling/_a_suwo.py @@ -81,7 +81,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} diff --git a/smote_variants/oversampling/_adasyn.py b/smote_variants/oversampling/_adasyn.py index 0ee63b3..692defc 100755 --- a/smote_variants/oversampling/_adasyn.py +++ b/smote_variants/oversampling/_adasyn.py @@ -68,7 +68,7 @@ def __init__(self, """ nn_params = coalesce(nn_params, {}) - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_amsco.py b/smote_variants/oversampling/_amsco.py index 7db6fcb..4359b51 100755 --- a/smote_variants/oversampling/_amsco.py +++ b/smote_variants/oversampling/_amsco.py @@ -128,7 +128,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_and_smote.py b/smote_variants/oversampling/_and_smote.py index d3107dc..2a2c8fa 100755 --- a/smote_variants/oversampling/_and_smote.py +++ b/smote_variants/oversampling/_and_smote.py @@ -75,7 +75,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_ans.py b/smote_variants/oversampling/_ans.py index 05a724e..9065ba6 100755 --- a/smote_variants/oversampling/_ans.py +++ b/smote_variants/oversampling/_ans.py @@ -66,7 +66,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_asmobd.py b/smote_variants/oversampling/_asmobd.py index 7154943..2e7683f 100755 --- a/smote_variants/oversampling/_asmobd.py +++ b/smote_variants/oversampling/_asmobd.py @@ -89,7 +89,7 @@ def __init__(self, like in sklearn """ ss_params = coalesce_dict(ss_params, {'n_dim': 2, - 'simplex_sampling': 'uniform', + 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None}) diff --git a/smote_variants/oversampling/_assembled_smote.py b/smote_variants/oversampling/_assembled_smote.py index 47a98e3..d9792a6 100755 --- a/smote_variants/oversampling/_assembled_smote.py +++ b/smote_variants/oversampling/_assembled_smote.py @@ -106,7 +106,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_borderline_smote.py b/smote_variants/oversampling/_borderline_smote.py index dccafde..717ac75 100755 --- a/smote_variants/oversampling/_borderline_smote.py +++ b/smote_variants/oversampling/_borderline_smote.py @@ -117,7 +117,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) @@ -301,7 +301,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_cbso.py b/smote_variants/oversampling/_cbso.py index a51cab8..76daf27 100755 --- a/smote_variants/oversampling/_cbso.py +++ b/smote_variants/oversampling/_cbso.py @@ -77,7 +77,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_ce_smote.py b/smote_variants/oversampling/_ce_smote.py index 56c1c04..9a2c5fd 100755 --- a/smote_variants/oversampling/_ce_smote.py +++ b/smote_variants/oversampling/_ce_smote.py @@ -91,7 +91,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_cluster_smote.py b/smote_variants/oversampling/_cluster_smote.py index b22445c..eb1f75f 100755 --- a/smote_variants/oversampling/_cluster_smote.py +++ b/smote_variants/oversampling/_cluster_smote.py @@ -76,7 +76,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_cure_smote.py b/smote_variants/oversampling/_cure_smote.py index 96d37c1..0313a77 100755 --- a/smote_variants/oversampling/_cure_smote.py +++ b/smote_variants/oversampling/_cure_smote.py @@ -78,7 +78,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_deago.py b/smote_variants/oversampling/_deago.py index d071efd..8f07a19 100755 --- a/smote_variants/oversampling/_deago.py +++ b/smote_variants/oversampling/_deago.py @@ -98,7 +98,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} diff --git a/smote_variants/oversampling/_distance_smote.py b/smote_variants/oversampling/_distance_smote.py index b0143af..e6bec6e 100755 --- a/smote_variants/oversampling/_distance_smote.py +++ b/smote_variants/oversampling/_distance_smote.py @@ -68,7 +68,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_dsrbf.py b/smote_variants/oversampling/_dsrbf.py index 06ac75e..c8eadf1 100755 --- a/smote_variants/oversampling/_dsrbf.py +++ b/smote_variants/oversampling/_dsrbf.py @@ -467,7 +467,7 @@ def __init__(self, self.n_neighbors = n_neighbors self.nn_params = coalesce(nn_params, {}) self.ss_params = coalesce_dict(ss_params, {'n_dim': 2, - 'simplex_sampling': 'uniform', + 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None}) self.params = {'m_min': hidden_range[0], diff --git a/smote_variants/oversampling/_e_smote.py b/smote_variants/oversampling/_e_smote.py index 6b401d7..5f12e06 100755 --- a/smote_variants/oversampling/_e_smote.py +++ b/smote_variants/oversampling/_e_smote.py @@ -93,7 +93,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} diff --git a/smote_variants/oversampling/_edge_det_smote.py b/smote_variants/oversampling/_edge_det_smote.py index 2ce547b..c6840a2 100755 --- a/smote_variants/oversampling/_edge_det_smote.py +++ b/smote_variants/oversampling/_edge_det_smote.py @@ -81,7 +81,7 @@ def __init__(self, like in sklearn """ nn_params = coalesce(nn_params, {}) - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_g_smote.py b/smote_variants/oversampling/_g_smote.py index 96678ec..9c251d9 100755 --- a/smote_variants/oversampling/_g_smote.py +++ b/smote_variants/oversampling/_g_smote.py @@ -97,7 +97,7 @@ def __init__(self, """ nn_params = coalesce(nn_params, {}) - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_gasmote.py b/smote_variants/oversampling/_gasmote.py index 591eaf6..e086069 100755 --- a/smote_variants/oversampling/_gasmote.py +++ b/smote_variants/oversampling/_gasmote.py @@ -84,7 +84,7 @@ def __init__(self, """ nn_params = coalesce(nn_params, {}) - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_gaussian_smote.py b/smote_variants/oversampling/_gaussian_smote.py index 28cc474..f308f05 100755 --- a/smote_variants/oversampling/_gaussian_smote.py +++ b/smote_variants/oversampling/_gaussian_smote.py @@ -65,7 +65,7 @@ def __init__(self, """ nn_params = coalesce(nn_params, {}) - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': {'sigma': sigma}} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_ismote.py b/smote_variants/oversampling/_ismote.py index 58dd46b..f076918 100755 --- a/smote_variants/oversampling/_ismote.py +++ b/smote_variants/oversampling/_ismote.py @@ -65,7 +65,7 @@ def __init__(self, like in sklearn """ nn_params = coalesce(nn_params, {}) - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_isomap_hybrid.py b/smote_variants/oversampling/_isomap_hybrid.py index e8ff811..40a95ad 100755 --- a/smote_variants/oversampling/_isomap_hybrid.py +++ b/smote_variants/oversampling/_isomap_hybrid.py @@ -82,7 +82,7 @@ def __init__(self, smote_n_neighbors (int): number of neighbors in SMOTE sampling n_jobs (int): number of parallel jobs """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} diff --git a/smote_variants/oversampling/_kmeans_smote.py b/smote_variants/oversampling/_kmeans_smote.py index 078b44e..6ddc7ab 100755 --- a/smote_variants/oversampling/_kmeans_smote.py +++ b/smote_variants/oversampling/_kmeans_smote.py @@ -75,7 +75,7 @@ def __init__(self, like in sklearn """ nn_params = coalesce(nn_params, {}) - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_lee.py b/smote_variants/oversampling/_lee.py index a080477..59e28c1 100755 --- a/smote_variants/oversampling/_lee.py +++ b/smote_variants/oversampling/_lee.py @@ -85,7 +85,7 @@ def __init__(self, """ nn_params = coalesce(nn_params, {}) - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} diff --git a/smote_variants/oversampling/_lle_smote.py b/smote_variants/oversampling/_lle_smote.py index 97a8c0f..c9e71a7 100755 --- a/smote_variants/oversampling/_lle_smote.py +++ b/smote_variants/oversampling/_lle_smote.py @@ -95,7 +95,7 @@ def __init__(self, """ nn_params = coalesce(nn_params, {}) - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_mct.py b/smote_variants/oversampling/_mct.py index 4688eb1..f544ed1 100755 --- a/smote_variants/oversampling/_mct.py +++ b/smote_variants/oversampling/_mct.py @@ -66,7 +66,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 1, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 1, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_mot2ld.py b/smote_variants/oversampling/_mot2ld.py index 1c508c2..8abfea2 100755 --- a/smote_variants/oversampling/_mot2ld.py +++ b/smote_variants/oversampling/_mot2ld.py @@ -94,7 +94,7 @@ def __init__(self, """ nn_params = coalesce(nn_params, {}) - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_msyn.py b/smote_variants/oversampling/_msyn.py index 69513c3..1308774 100755 --- a/smote_variants/oversampling/_msyn.py +++ b/smote_variants/oversampling/_msyn.py @@ -88,7 +88,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} diff --git a/smote_variants/oversampling/_mwmote.py b/smote_variants/oversampling/_mwmote.py index b338ec2..9379dc8 100755 --- a/smote_variants/oversampling/_mwmote.py +++ b/smote_variants/oversampling/_mwmote.py @@ -106,7 +106,7 @@ def __init__(self, """ nn_params = coalesce(nn_params, {}) - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_ndo_sampling.py b/smote_variants/oversampling/_ndo_sampling.py index 4f4f302..866e697 100755 --- a/smote_variants/oversampling/_ndo_sampling.py +++ b/smote_variants/oversampling/_ndo_sampling.py @@ -82,7 +82,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_neater.py b/smote_variants/oversampling/_neater.py index 26677d7..f7b444c 100755 --- a/smote_variants/oversampling/_neater.py +++ b/smote_variants/oversampling/_neater.py @@ -91,7 +91,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_nras.py b/smote_variants/oversampling/_nras.py index 2925179..11efca7 100755 --- a/smote_variants/oversampling/_nras.py +++ b/smote_variants/oversampling/_nras.py @@ -70,7 +70,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_nrsboundary_smote.py b/smote_variants/oversampling/_nrsboundary_smote.py index d611882..10c4b92 100755 --- a/smote_variants/oversampling/_nrsboundary_smote.py +++ b/smote_variants/oversampling/_nrsboundary_smote.py @@ -66,7 +66,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_nt_smote.py b/smote_variants/oversampling/_nt_smote.py index 4490350..2c1d13b 100755 --- a/smote_variants/oversampling/_nt_smote.py +++ b/smote_variants/oversampling/_nt_smote.py @@ -84,7 +84,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 3, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 3, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_oups.py b/smote_variants/oversampling/_oups.py index 2f27df1..1e3bc70 100755 --- a/smote_variants/oversampling/_oups.py +++ b/smote_variants/oversampling/_oups.py @@ -61,7 +61,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_polynom_fit_smote.py b/smote_variants/oversampling/_polynom_fit_smote.py index 00fb2c9..82f4cfc 100755 --- a/smote_variants/oversampling/_polynom_fit_smote.py +++ b/smote_variants/oversampling/_polynom_fit_smote.py @@ -440,7 +440,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'deterministic', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_prowsyn.py b/smote_variants/oversampling/_prowsyn.py index bf3f186..ebde81e 100755 --- a/smote_variants/oversampling/_prowsyn.py +++ b/smote_variants/oversampling/_prowsyn.py @@ -79,7 +79,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_rwo_sampling.py b/smote_variants/oversampling/_rwo_sampling.py index 7985603..267ab20 100755 --- a/smote_variants/oversampling/_rwo_sampling.py +++ b/smote_variants/oversampling/_rwo_sampling.py @@ -57,7 +57,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 1, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 1, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_sdsmote.py b/smote_variants/oversampling/_sdsmote.py index 3ad8c95..4296b56 100755 --- a/smote_variants/oversampling/_sdsmote.py +++ b/smote_variants/oversampling/_sdsmote.py @@ -85,7 +85,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_sl_graph_smote.py b/smote_variants/oversampling/_sl_graph_smote.py index 27ef520..ff4c456 100755 --- a/smote_variants/oversampling/_sl_graph_smote.py +++ b/smote_variants/oversampling/_sl_graph_smote.py @@ -70,7 +70,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} diff --git a/smote_variants/oversampling/_smmo.py b/smote_variants/oversampling/_smmo.py index 18e6bac..eca1402 100755 --- a/smote_variants/oversampling/_smmo.py +++ b/smote_variants/oversampling/_smmo.py @@ -85,7 +85,7 @@ def __init__(self, ss_params (dict): simplex sampling parameters n_jobs (int): number of parallel jobs """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_smote.py b/smote_variants/oversampling/_smote.py index 9fb2c05..e596efc 100755 --- a/smote_variants/oversampling/_smote.py +++ b/smote_variants/oversampling/_smote.py @@ -61,7 +61,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_smote_enn.py b/smote_variants/oversampling/_smote_enn.py index b669c9a..638db0c 100755 --- a/smote_variants/oversampling/_smote_enn.py +++ b/smote_variants/oversampling/_smote_enn.py @@ -79,7 +79,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} diff --git a/smote_variants/oversampling/_smote_frst_2t.py b/smote_variants/oversampling/_smote_frst_2t.py index 1c90a2c..9cd1c95 100755 --- a/smote_variants/oversampling/_smote_frst_2t.py +++ b/smote_variants/oversampling/_smote_frst_2t.py @@ -87,7 +87,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} diff --git a/smote_variants/oversampling/_smote_ipf.py b/smote_variants/oversampling/_smote_ipf.py index 5d91d4d..59ddd58 100755 --- a/smote_variants/oversampling/_smote_ipf.py +++ b/smote_variants/oversampling/_smote_ipf.py @@ -86,7 +86,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} diff --git a/smote_variants/oversampling/_smote_psobat.py b/smote_variants/oversampling/_smote_psobat.py index 28b9b53..de9bcac 100755 --- a/smote_variants/oversampling/_smote_psobat.py +++ b/smote_variants/oversampling/_smote_psobat.py @@ -103,7 +103,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} diff --git a/smote_variants/oversampling/_smote_rsb.py b/smote_variants/oversampling/_smote_rsb.py index 4ac043e..03d210f 100755 --- a/smote_variants/oversampling/_smote_rsb.py +++ b/smote_variants/oversampling/_smote_rsb.py @@ -85,7 +85,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} diff --git a/smote_variants/oversampling/_smote_tomeklinks.py b/smote_variants/oversampling/_smote_tomeklinks.py index 723f0f0..08b9e32 100755 --- a/smote_variants/oversampling/_smote_tomeklinks.py +++ b/smote_variants/oversampling/_smote_tomeklinks.py @@ -76,7 +76,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} diff --git a/smote_variants/oversampling/_sn_smote.py b/smote_variants/oversampling/_sn_smote.py index cf20df7..5891a4f 100755 --- a/smote_variants/oversampling/_sn_smote.py +++ b/smote_variants/oversampling/_sn_smote.py @@ -71,7 +71,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_soi_cj.py b/smote_variants/oversampling/_soi_cj.py index 5ec96f1..f0386cb 100755 --- a/smote_variants/oversampling/_soi_cj.py +++ b/smote_variants/oversampling/_soi_cj.py @@ -69,7 +69,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 1, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 1, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_somo.py b/smote_variants/oversampling/_somo.py index 59b90de..c94f045 100755 --- a/smote_variants/oversampling/_somo.py +++ b/smote_variants/oversampling/_somo.py @@ -72,7 +72,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_supervised_smote.py b/smote_variants/oversampling/_supervised_smote.py index a21dbd8..cd085c0 100755 --- a/smote_variants/oversampling/_supervised_smote.py +++ b/smote_variants/oversampling/_supervised_smote.py @@ -73,7 +73,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_svm_balance.py b/smote_variants/oversampling/_svm_balance.py index fed89ff..76d0288 100755 --- a/smote_variants/oversampling/_svm_balance.py +++ b/smote_variants/oversampling/_svm_balance.py @@ -78,7 +78,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} diff --git a/smote_variants/oversampling/_trim_smote.py b/smote_variants/oversampling/_trim_smote.py index 2c51cef..b4c0d46 100755 --- a/smote_variants/oversampling/_trim_smote.py +++ b/smote_variants/oversampling/_trim_smote.py @@ -78,7 +78,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/smote_variants/oversampling/_vis_rst.py b/smote_variants/oversampling/_vis_rst.py index d08b19a..1b63dec 100755 --- a/smote_variants/oversampling/_vis_rst.py +++ b/smote_variants/oversampling/_vis_rst.py @@ -74,7 +74,7 @@ def __init__(self, random_state (int/RandomState/None): initializer of random_state, like in sklearn """ - ss_params_default = {'n_dim': 2, 'simplex_sampling': 'uniform', + ss_params_default = {'n_dim': 2, 'simplex_sampling': 'random', 'within_simplex_sampling': 'random', 'gaussian_component': None} ss_params = coalesce_dict(ss_params, ss_params_default) diff --git a/tests/test_simplexsampling.py b/tests/test_simplexsampling.py index 9c7a115..537d77f 100644 --- a/tests/test_simplexsampling.py +++ b/tests/test_simplexsampling.py @@ -127,7 +127,7 @@ def test_simplexsamplingmixin_dim2_uniform_deterministic(): """ Testing uniform and deterministic sampling in 2D. """ - ssm = SimplexSamplingMixin(simplex_sampling='uniform', + ssm = SimplexSamplingMixin(simplex_sampling='random', within_simplex_sampling='deterministic', n_dim=2, random_state=5) @@ -162,7 +162,7 @@ def test_simplexsamplingmixin_dim2_uniform_random(): """ Testing uniform and random sampling in 2D. """ - ssm = SimplexSamplingMixin(simplex_sampling='uniform', + ssm = SimplexSamplingMixin(simplex_sampling='random', within_simplex_sampling='random', n_dim=2, random_state=5) @@ -338,7 +338,7 @@ def test_simplexsamplingmixin_dim2_vertex_weights(): assert np.all(np.logical_and(samples[:, 1] <= 2.005, samples[:, 1] >= 2.0)) - ssm = SimplexSamplingMixin(simplex_sampling='uniform', + ssm = SimplexSamplingMixin(simplex_sampling='random', within_simplex_sampling='random', n_dim=2, random_state=5)