lale.lib.imblearn.adasyn module¶
- class lale.lib.imblearn.adasyn.ADASYN(*, operator, sampling_strategy='auto', random_state=None, n_neighbors=5, n_jobs=1)¶
Bases:
PlannedIndividualOp
Perform over-sampling using Adaptive Synthetic (ADASYN) sampling approach for imbalanced datasets.
This documentation is auto-generated from JSON schemas.
- Parameters
operator (operator, optional) –
Trainable Lale pipeline that is trained using the data obtained from the current imbalance corrector.
Predict, transform, predict_proba or decision_function would just be forwarded to the trained pipeline. If operator is a Planned pipeline, the current imbalance corrector can’t be trained without using an optimizer to choose a trainable operator first. Please refer to lale/examples for more examples.
sampling_strategy (union type, optional, not for optimizer, default 'auto') –
Sampling information to resample the data set.
float, not for optimizer
Desired ratio of the number of samples in the minority class over the number of samples in the majority class after resampling. Therefore, the ratio is expressed as where is the number of samples in the minority class after resampling and is the number of samples in the majority class.
Warning
Only available for binary classification. An error is raised for multi-class classification.
or ‘minority’, ‘not minority’, ‘not majority’, ‘all’, or ‘auto’
The class targeted by the resampling. The number of samples in the different classes will be equalized. Possible choices are:
'minority'
: resample only the minority class;'not minority'
: resample all classes but the minority class;'not majority'
: resample all classes but the majority class;'all'
: resample all classes;'auto'
: equivalent to'not majority'
.
or dict, not for optimizer
Keys correspond to the targeted classes and values correspond to the desired number of samples for each targeted class.
or callable, not for optimizer
Function taking
y
and returns adict
. The keys correspond to the targeted classes and the values correspond to the desired number of samples for each class.
random_state (union type, optional, not for optimizer, default None) –
Control the randomization of the algorithm.
None
RandomState used by np.random
or integer
The seed used by the random number generator
or numpy.random.RandomState
Random number generator instance.
n_neighbors (union type, optional, not for optimizer, default 5) –
Number of neighbors.
integer
Number of nearest neighbours to use to construct synthetic samples.
or Any
An estimator that inherits from
sklearn.neighbors.base.KNeighborsMixin
that will be used to find the n_neighbors.
n_jobs (integer, optional, not for optimizer, default 1) – The number of threads to open if possible.
- decision_function(X)¶
Confidence scores for all classes.
Note: The decision_function method is not available until this operator is trained.
Once this method is available, it will have the following signature:
- Parameters
X (array of items : array of items : float) – Features; the outer array is over samples.
- Returns
result – Output data schema for predictions.
- Return type
Any
- fit(X, y=None, **fit_params)¶
Train the operator.
Note: The fit method is not available until this operator is trainable.
Once this method is available, it will have the following signature:
- Parameters
X (array of items : array of items : float) – Features; the outer array is over samples.
y (union type) –
Target class labels; the array is over samples.
array of items : float
or array of items : string
- predict(X, **predict_params)¶
Make predictions.
Note: The predict method is not available until this operator is trained.
Once this method is available, it will have the following signature:
- Parameters
X (array of items : array of items : float) – Features; the outer array is over samples.
- Returns
result – Output data schema for predictions.
- Return type
Any
- predict_proba(X)¶
Probability estimates for all classes.
Note: The predict_proba method is not available until this operator is trained.
Once this method is available, it will have the following signature:
- Parameters
X (array of items : array of items : float) – Features; the outer array is over samples.
- Returns
result – Probability of the sample for each class in the model.
- Return type
array of items : array of items : float
- transform(X, y=None)¶
Transform the data.
Note: The transform method is not available until this operator is trained.
Once this method is available, it will have the following signature:
- Parameters
X (array of items : array of items : float) – Features; the outer array is over samples.
y (union type) –
Target class labels; the array is over samples.
array of items : float
or array of items : string
or None
- Returns
result – Output data schema for transformed data.
- Return type
Any