示例#

用于imbalanced-learn工具箱的通用和入门示例。

展示API imbalanced-learn用法的示例#

展示一些关于imbalanced-learn API细节的示例。

如何在imbalanced-learn中使用sampling_strategy

How to use sampling_strategy in imbalanced-learn

基于真实世界数据集的示例#

使用真实世界数据集的示例。

多类分类与欠采样

Multiclass classification with under-sampling

文本文档中的主题分类示例

Example of topic classification in text documents

自定义采样器以实现异常值拒绝估计器

Customized sampler to implement an outlier rejections estimator

在人脸识别任务中基准过采样方法

Benchmark over-sampling methods in a face recognition task

Porto Seguro: 使用Keras在小批量中平衡样本

Porto Seguro: balancing samples in mini-batches with Keras

在不平衡数据集上拟合模型以及如何对抗偏差

Fitting model on imbalanced datasets and how to fight bias

使用combine类方法的示例#

结合方法混合了过采样和欠采样方法。通常使用SMOTE进行过采样,而一些清理方法(即ENN和Tomek链接)用于欠采样。

比较采样器结合过采样和欠采样

Compare sampler combining over- and under-sampling

数据集示例#

关于imblearn.datasets模块的示例。

创建一个不平衡的数据集

Create an imbalanced dataset

使用集成类方法的示例#

欠采样方法意味着在平衡过程中会丢失多数类的样本。 集成方法提供了一种使用大多数样本的替代方案。 实际上,创建了一组平衡集,并用于后续训练任何分类器。

使用采样器的Bagging分类器

Bagging classifiers using sampler

使用重采样比较集成分类器

Compare ensemble classifiers using resampling

评估示例#

展示如何使用不平衡数据集进行分类的示例。

通过编译报告评估分类

Evaluate classification by compiling a report

不平衡学习特定的指标

Metrics specific to imbalanced learning

模型选择#

与平衡方法选择相关的示例。

绘制验证曲线

Plotting Validation Curves

使用过采样类方法的示例#

数据平衡可以通过过采样来执行,以便在少数类中生成新样本以达到给定的平衡比例。

用于类似SMOTE采样器的样本生成器

Sample generator used in SMOTE-like samplers

随机过采样中收缩因子的影响

Effect of the shrinkage factor in random over-sampling

比较过采样采样器

Compare over-sampling samplers

管道示例#

示例如何使用管道在scikit-learn估计器中包含欠采样。

管道嵌入采样器的使用

Usage of pipeline embedding samplers

使用欠采样类方法的示例#

欠采样是指减少多数类样本数量的过程。 实现的方法可以分为两类:(i) 固定欠采样和(ii) 清理欠采样。

Tomek链接定义的图示

Illustration of the definition of a Tomek link

NearMiss中的样本选择

Sample selection in NearMiss

比较欠采样采样器

Compare under-sampling samplers

图库由Sphinx-Gallery生成