安装地址:https://github.com/scikit-learn-contrib/imbalanced-learn
参考:https://blog.youkuaiyun.com/kizgel/article/details/78553009#214-数学公式
Help on package imblearn:
NAME
imblearn - Toolbox for imbalanced dataset in machine learning.
DESCRIPTION
``imbalanced-learn`` is a set of python methods to deal with imbalanced
datset in machine learning and pattern recognition.
Subpackages
-----------
combine
Module which provides methods based on over-sampling and under-sampling.
ensemble
Module which provides methods generating an ensemble of
under-sampled subsets.
exceptions
Module including custom warnings and error clases used across
imbalanced-learn.
keras
Module which provides custom generator, layers for deep learning using
keras.
metrics
Module which provides metrics to quantified the classification performance
with imbalanced dataset.
over_sampling
Module which provides methods to under-sample a dataset.
tensorflow
Module which provides custom generator, layers for deep learning using
tensorflow.
under-sampling
Module which provides methods to over-sample a dataset.
utils
Module including various utilities.
pipeline
Module which allowing to create pipeline with scikit-learn estimators.
PACKAGE CONTENTS
_version
base
combine (package)
datasets (package)
ensemble (package)
exceptions
keras (package)
metrics (package)
over_sampling (package)
pipeline
tensorflow (package)
tests (package)
under_sampling (package)
utils (package)
CLASSES
imblearn.base.BaseSampler(imblearn.base.SamplerMixin)
imblearn.base.FunctionSampler
class FunctionSampler(BaseSampler)
| Construct a sampler from calling an arbitrary callable.
|
| Read more in the :ref:`User Guide <function_sampler>`.
|
| Parameters
| ----------
| func : callable or None,
| The callable to use for the transformation. This will be passed the
| same arguments as transform, with args and kwargs forwarded. If func is
| None, then func will be the identity function.
|
| accept_sparse : bool, optional (default=True)
| Whether sparse input are supported. By default, sparse inputs are
| supported.
|
| kw_args : dict, optional (default=None)
| The keyword argument expected by ``func``.
|
| Notes
| -----
|
| See
| :ref:`sphx_glr_auto_examples_plot_outlier_rejections.py`
|
| Examples
| --------
| >>> import numpy as np
| >>> from sklearn.datasets import make_classification
| >>> from imblearn import FunctionSampler
| >>> X, y = make_classification(n_classes=2, class_sep=2,
| .