Skip to content

Commit 56dfd8a

Browse files
committed
iter
1 parent c9f681c commit 56dfd8a

File tree

3 files changed

+27
-18
lines changed

3 files changed

+27
-18
lines changed

azure-pipelines.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,7 @@ jobs:
2020
parameters:
2121
name: Linux
2222
vmImage: ubuntu-18.04
23-
dependsOn: [linting]
2423
matrix:
25-
# Linux environment to test that scikit-learn can be built against
26-
# versions of numpy, scipy with ATLAS that comes with Ubuntu Bionic 18.04
27-
# i.e. numpy 1.13.3 and scipy 0.19
28-
py36_ubuntu_atlas:
29-
DISTRIB: 'ubuntu'
30-
PYTHON_VERSION: '3.6'
31-
JOBLIB_VERSION: '*'
32-
# Linux environment to test the latest available dependencies and MKL.
3324
pylatest_pip_openblas_pandas:
3425
DISTRIB: 'conda-pip-latest'
3526
PYTHON_VERSION: '3.9'
@@ -38,6 +29,20 @@ jobs:
3829
TEST_DOCSTRINGS: 'true'
3930
JOBLIB_VERSION: '*'
4031
CHECK_WARNINGS: 'true'
32+
33+
- template: build_tools/azure/posix.yml
34+
parameters:
35+
name: Linux
36+
vmImage: ubuntu-18.04
37+
dependsOn: [linting]
38+
matrix:
39+
# Linux environment to test that scikit-learn can be built against
40+
# versions of numpy, scipy with ATLAS that comes with Ubuntu Bionic 18.04
41+
# i.e. numpy 1.13.3 and scipy 0.19
42+
py36_ubuntu_atlas:
43+
DISTRIB: 'ubuntu'
44+
PYTHON_VERSION: '3.6'
45+
JOBLIB_VERSION: '*'
4146
pylatest_conda_pandas_keras:
4247
DISTRIB: 'conda'
4348
PYTHON_VERSION: '3.7'

imblearn/over_sampling/_random_over_sampler.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,19 @@ class RandomOverSampler(BaseOverSampler):
3838
{random_state}
3939
4040
smoothed_bootstrap : bool, default=False
41-
Whether or not to generate smoothed bootstrap samples.
41+
Whether or not to generate smoothed bootstrap samples. When this option
42+
is triggered, be aware that the data to be resampled needs to be
43+
numerical data since a Gaussian perturbation will be generated and
44+
added to the bootstrap.
4245
4346
.. versionadded:: 0.7
4447
4548
shrinkage : float or dict, default=1.0
46-
Factor used to shrink the covariance matrix used to generate the
47-
smoothed bootstrap. If a float is given, the same factor is applied to
48-
generate the bootstrap samples for the classes provided in
49-
`sampling_strategy`. If a dictionary is given, different factors will
50-
be used to generate the bootstrap samples. The key of the dictionary
51-
corresponds to the class and the value to the shrinkage factor.
49+
Factor to shrink the covariance matrix used to generate the
50+
smoothed bootstrap. A factor could be shared by all classes by
51+
providing a floating number or different for each class over-sampled
52+
by providing a dictionary where the key are the class targeted and the
53+
value is the shrinkage factor.
5254
5355
.. versionadded:: 0.7
5456
@@ -86,7 +88,7 @@ class RandomOverSampler(BaseOverSampler):
8688
Supports heterogeneous data as object array containing string and numeric
8789
data.
8890
89-
When generating smoothed bootstrap, this method is also known as Random
91+
When generating a smoothed bootstrap, this method is also known as Random
9092
Over-Sampling Examples (ROSE) [1]_.
9193
9294
.. warning::

imblearn/over_sampling/tests/test_random_over_sampler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ def test_ros_fit_resample(X_type, data, params):
9393
def test_ros_fit_resample_half(data, params):
9494
X, Y = data
9595
sampling_strategy = {0: 3, 1: 7}
96-
ros = RandomOverSampler(**params, sampling_strategy=sampling_strategy, random_state=RND_SEED)
96+
ros = RandomOverSampler(
97+
**params, sampling_strategy=sampling_strategy, random_state=RND_SEED
98+
)
9799
X_resampled, y_resampled = ros.fit_resample(X, Y)
98100
X_gt = np.array(
99101
[

0 commit comments

Comments
 (0)