@@ -26,13 +26,13 @@ def make_imbalance(
26
26
27
27
Parameters
28
28
----------
29
- X : {array-like, dataframe}, shape (n_samples, n_features)
29
+ X : {array-like, dataframe} of shape (n_samples, n_features)
30
30
Matrix containing the data to be imbalanced.
31
31
32
- y : ndarray, shape (n_samples, )
32
+ y : ndarray of shape (n_samples,)
33
33
Corresponding label for each sample in X.
34
34
35
- sampling_strategy : dict, or callable,
35
+ sampling_strategy : dict or callable,
36
36
Ratio to use for resampling the data set.
37
37
38
38
- When ``dict``, the keys correspond to the targeted classes. The
@@ -43,25 +43,25 @@ def make_imbalance(
43
43
correspond to the targeted classes. The values correspond to the
44
44
desired number of samples for each class.
45
45
46
- random_state : int, RandomState instance or None, optional ( default=None)
46
+ random_state : int, RandomState instance or None, default=None
47
47
If int, random_state is the seed used by the random number generator;
48
48
If RandomState instance, random_state is the random number generator;
49
49
If None, the random number generator is the RandomState instance used
50
50
by np.random.
51
51
52
- verbose : bool, optional ( default=False)
52
+ verbose : bool, default=False
53
53
Show information regarding the sampling.
54
54
55
- kwargs : dict, optional
55
+ kwargs : dict
56
56
Dictionary of additional keyword arguments to pass to
57
57
``sampling_strategy``.
58
58
59
59
Returns
60
60
-------
61
- X_resampled : {ndarray, dataframe}, shape (n_samples_new, n_features)
61
+ X_resampled : {ndarray, dataframe} of shape (n_samples_new, n_features)
62
62
The array containing the imbalanced data.
63
63
64
- y_resampled : ndarray, shape (n_samples_new)
64
+ y_resampled : ndarray of shape (n_samples_new)
65
65
The corresponding label of `X_resampled`
66
66
67
67
Notes
@@ -86,7 +86,6 @@ def make_imbalance(
86
86
... random_state=42)
87
87
>>> print('Distribution after imbalancing: {}'.format(Counter(y_res)))
88
88
Distribution after imbalancing: Counter({2: 30, 1: 20, 0: 10})
89
-
90
89
"""
91
90
target_stats = Counter (y )
92
91
# restrict ratio to be a dict or a callable
0 commit comments