Base
Base class for distributors.
BaseDistributor
Bases: BaseEstimator
The base class for distributors.
A distributor sets the proportion of samples to be generated inside each cluster and between clusters. Warning: This class should not be used directly. Use the derive classes instead.
fit(X, y, labels=None, neighbors=None)
Generate the intra-label and inter-label distribution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
InputData
|
Matrix containing the data which have to be sampled. |
required |
y
|
Targets
|
Corresponding label for each sample in X. |
required |
labels
|
Labels | None
|
Labels of each sample. |
None
|
neighbors
|
Neighbors | None
|
An array that contains all neighboring pairs. Each row is a unique neighboring pair. |
None
|
Returns:
Type | Description |
---|---|
Self
|
The object itself. |
Source code in src/imblearn_extra/clover/distribution/base.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
|
fit_distribute(X, y, labels, neighbors)
Return the intra-label and inter-label distribution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
InputData
|
Matrix containing the data which have to be sampled. |
required |
y
|
Targets
|
Corresponding label for each sample in X. |
required |
labels
|
Labels | None
|
Labels of each sample. |
required |
neighbors
|
Neighbors | None
|
An array that contains all neighboring pairs. Each row is a unique neighboring pair. |
required |
Returns:
Name | Type | Description |
---|---|---|
distributions |
tuple[IntraDistribution, InterDistribution]
|
A tuple with the two distributions. |
Source code in src/imblearn_extra/clover/distribution/base.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
|