imbalanced-ensemble

imbalanced-ensemble

专注类别不平衡的Python集成学习库

imbalanced-ensemble是一个针对类别不平衡数据的Python集成学习库。该库提供15种以上的集成不平衡学习算法和19种采样方法,特点包括易用API、优化性能和强大可视化功能。完全兼容scikit-learn和imbalanced-learn,支持二分类和多分类任务。imbalanced-ensemble适用于类别不平衡集成学习模型的快速实现、修改、评估和可视化。

IMBENS类别不平衡集成学习Python机器学习Github开源项目

<!-- ![](https://raw.githubusercontent.com/ZhiningLiu1998/figures/master/imbalanced-ensemble/example_gallery_snapshot_horizontal.png) --> <h1 align="center"> IMBENS: Class-imbalanced Ensemble Learning in Python </h1> <table align="center"> <tr> <td>Status</td> <td> <a href="https://codecov.io/gh/ZhiningLiu1998/imbalanced-ensemble"> <img src="https://codecov.io/gh/ZhiningLiu1998/imbalanced-ensemble/branch/main/graph/badge.svg?token=46Y73QPA68"></a> <a href='https://dl.circleci.com/status-badge/redirect/gh/ZhiningLiu1998/imbalanced-ensemble/tree/main'> <img src='https://dl.circleci.com/status-badge/img/gh/ZhiningLiu1998/imbalanced-ensemble/tree/main.svg?style=shield' alt='CircleCI Status'></a> <a href='https://imbalanced-ensemble.readthedocs.io/en/latest/?badge=latest'> <img alt="Read the Docs" src="https://img.shields.io/readthedocs/imbalanced-ensemble"></a> <!-- <img src='https://readthedocs.org/projects/imbalanced-ensemble/badge/?version=latest'></a> --> <a href="https://github.com/psf/black"> <img src="https://img.shields.io/badge/code%20style-black-000000.svg"></a> <a href="https://github.com/ZhiningLiu1998/imbalanced-ensemble/blob/master/LICENSE"> <img src="https://img.shields.io/github/license/ZhiningLiu1998/imbalanced-ensemble"></a> <a href="https://github.com/ZhiningLiu1998/imbalanced-ensemble/issues"> <img src="https://img.shields.io/github/issues/ZhiningLiu1998/imbalanced-ensemble?logo=github"></a> </td> </tr> <tr> <td>PyPI</td> <td> <a href="https://pypi.org/project/imbalanced-ensemble/"> <img src="https://img.shields.io/badge/PyPi-imbalanced--ensemble-3775A9?logo=pypi&labelColor=white"></a> <a href="https://pypi.org/project/imbalanced-ensemble/"> <img src="https://img.shields.io/pypi/v/imbalanced-ensemble?logo=pypi&label=version&labelColor=white&color=3775A9"></a> <a href="https://www.python.org/"> <img src="https://img.shields.io/pypi/pyversions/imbalanced-ensemble.svg?logo=python&labelColor=white"></a> </td> </tr> <tr> <td>Traffic</td> <td> <a href="https://pepy.tech/project/imbalanced-ensemble"> <img src="https://img.shields.io/github/stars/ZhiningLiu1998/imbalanced-ensemble"></a> <a href="https://github.com/ZhiningLiu1998/imbalanced-ensemble/network/members"> <img src="https://img.shields.io/github/forks/ZhiningLiu1998/imbalanced-ensemble"></a> <a href="https://pepy.tech/project/imbalanced-ensemble"> <img src="https://pepy.tech/badge/imbalanced-ensemble"></a> <a href="https://pepy.tech/project/imbalanced-ensemble"> <img src="https://pepy.tech/badge/imbalanced-ensemble/month"></a> <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> <a href="https://github.com/ZhiningLiu1998/imbalanced-ensemble#contributors-"><img src="https://img.shields.io/badge/all_contributors-5-orange.svg"></a> <!-- ALL-CONTRIBUTORS-BADGE:END --> </td> </tr> <tr> <td>Documentation</td> <td> <a href="https://imbalanced-ensemble.readthedocs.io/en/latest/"> <img src="https://img.shields.io/badge/ReadTheDoc-Latest-green?logo=readthedocs&labelColor=376681"></a> <a href="https://imbalanced-ensemble.readthedocs.io/en/latest/release_history.html"> <img src="https://img.shields.io/badge/Doc-Changelog-blue?logo=readthedocs"></a> <a href="https://imbalanced-ensemble.readthedocs.io/en/latest/auto_examples/index.html#"> <img src="https://img.shields.io/badge/Doc-Examples & Gallery-blue?logo=readthedocs"></a> <a href="https://imbalanced-ensemble.readthedocs.io/en/latest/api/ensemble/api.html"> <img src="https://img.shields.io/badge/Doc-API Reference-blue?logo=readthedocs"></a> </td> </tr> <tr> <td>Paper & Citation</td> <td> <a href="https://arxiv.org/abs/2111.12776"> <img src="https://img.shields.io/badge/arXiv-2111.12776-B31B1B?logo=arXiv"></a> <a href="https://arxiv.org/pdf/2111.12776"> <img src="https://img.shields.io/badge/arXiv-PDF-B31B1B?logo=arXiv"></a> <a href="https://zhuanlan.zhihu.com/p/376572330"> <img src="https://img.shields.io/badge/Blog-知乎/Zhihu-0084ff?logo=Zhihu&labelColor=white"></a> <a href="https://scholar.google.com/scholar?q=IMBENS%3A+Ensemble+class-imbalanced+learning+in+Python"> <img src="https://img.shields.io/badge/Citation-Bibtex-4285F4?logo=googlescholar&labelColor=white"></a> </td> </tr> <tr> <td>Language</td> <td> <a href="https://github.com/ZhiningLiu1998/imbalanced-ensemble"> <img src="https://img.shields.io/badge/README-English-blue?logo=github&labelColor=black"></a> <a href="https://github.com/ZhiningLiu1998/imbalanced-ensemble/blob/main/docs/README_CN.md"> <img src="https://img.shields.io/badge/README-中文-blue?logo=github&labelColor=black"></a> </td> </tr> </table> <h3 align="center"> ⏳Quick Start with our <a href="https://github.com/ZhiningLiu1998/imbalanced-ensemble#5-min-quick-start-with-imbens">5-minute Guide</a> & <a href="https://imbalanced-ensemble.readthedocs.io/en/latest/auto_examples/index.html#">Detailed Examples</a> </h3>

IMBENS (imported as imbens) is a Python library for quick implementation, modification, evaluation, and visualization of ensemble learning from class-imbalanced data. Currently, IMBENS includes over 15 ensemble imbalanced learning algorithms (SMOTEBoost, SMOTEBagging, RUSBoost, EasyEnsemble, SelfPacedEnsemble, etc) and 19 over-/under-sampling methods (SMOTE, ADASYN, TomekLinks, etc) from imbalance-learn.

<h2 align="left">🌈 IMBENS Highlights</h2>
  • 🧑‍💻 Ease-of-use: Unified, easy-to-use APIs with documentation and examples.
  • 🚀 Performance: Optimized performance with parallelization using joblib.
  • 📊 Benchmarking: Running & comparing multiple models with our visualizer.
  • 📺 Monitoring: Powerful, customizable, interactive training logging.
  • 🪐 Versatility: Full compatibility with scikit-learn and imbalanced-learn.
  • 📈 Functionality: Extending existing techniques from binary to multi-class setting.

✂️ Use IMBENS for class-imbalanced classification with <5 lines of code:

# Train an SPE classifier from imbens.ensemble import SelfPacedEnsembleClassifier clf = SelfPacedEnsembleClassifier(random_state=42) clf.fit(X_train, y_train) # Predict with an SPE classifier y_pred = clf.predict(X_test)

🤗 Citing IMBENS

🍻 We appreciate your citation if you find our work helpful! The BibTeX entry:

@article{liu2023imbens, title={IMBENS: Ensemble Class-imbalanced Learning in Python}, author={Liu, Zhining and Kang, Jian and Tong, Hanghang and Chang, Yi}, journal={arXiv preprint arXiv:2111.12776}, year={2023} }

👯‍♂️ Contribute to IMBENS

Join us and become a contributor! Please refer to the contributing guidelines.

<h2 align="left">📚 Table of Contents</h2>

Installation

It is recommended to use pip for installation.
Please make sure the latest version is installed to avoid potential problems:

$ pip install imbalanced-ensemble # normal install $ pip install --upgrade imbalanced-ensemble # update if needed

Or you can install imbalanced-ensemble by clone this repository:

$ git clone https://github.com/ZhiningLiu1998/imbalanced-ensemble.git $ cd imbalanced-ensemble $ pip install .

imbalanced-ensemble requires following dependencies:

<!-- ## Highlights - &#x1F34E; ***Unified, easy-to-use API design.*** All ensemble learning methods implemented in IMBENS share a unified API design. Similar to sklearn, all methods have functions (e.g., `fit()`, `predict()`, `predict_proba()`) that allow users to deploy them with only a few lines of code. - &#x1F34E; ***Extended functionalities, wider application scenarios.*** *All methods in IMBENS are ready for **multi-class imbalanced classification**.* We extend binary ensemble imbalanced learning methods to get them to work under the multi-class scenario. Additionally, for supported methods, we provide more training options like class-wise resampling control, balancing scheduler during the ensemble training process, etc. - &#x1F34E; ***Detailed training log, quick intuitive visualization.*** We provide additional parameters (e.g., `eval_datasets`, `eval_metrics`, `training_verbose`) in `fit()` for users to control the information they want to monitor during the ensemble training. We also implement an [`EnsembleVisualizer`](https://imbalanced-ensemble.readthedocs.io/en/latest/api/visualizer/_autosummary/imbens.visualizer.ImbalancedEnsembleVisualizer.html) to quickly visualize the ensemble estimator(s) for providing further information/conducting comparison. See an example [here](https://imbalanced-ensemble.readthedocs.io/en/latest/auto_examples/basic/plot_basic_example.html#sphx-glr-auto-examples-basic-plot-basic-example-py). - &#x1F34E; ***Wide compatiblilty.*** IMBENS is designed to be compatible with [scikit-learn](https://scikit-learn.org/stable/) (sklearn) and also other compatible projects like [imbalanced-learn](https://imbalanced-learn.org/stable/). Therefore, users can take advantage of various utilities from the sklearn community for data processing/cross-validation/hyper-parameter tuning, etc. --> <!-- ## Background Class-imbalance (also known as the long-tail problem in multi-class) is the fact that the classes are not represented equally in a classification problem, which is quite common in practice. For instance, fraud detection, prediction of rare adverse drug reactions and prediction gene families. Failure to account for the class imbalance often causes inaccurate and decreased predictive performance of many classification algorithms. Imbalanced learning (IL) aims to tackle the class imbalance problem to learn an unbiased model from imbalanced data. This is usually achieved by changing the training data distribution by resampling or reweighting. However, naive resampling or reweighting may introduce bias/variance to the training data, especially when the data has class-overlapping or contains noise. Ensemble imbalanced learning (EIL) is known to effectively improve typical IL solutions by combining the outputs of multiple classifiers, thereby reducing the variance introduce by resampling/reweighting. -->

List of implemented methods

Currently (v0.1.3, 2021/06), 16 ensemble imbalanced learning methods were implemented:
(Click to jump to the document page)

编辑推荐精选

博思AIPPT

博思AIPPT

AI一键生成PPT,就用博思AIPPT!

博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。

AI办公办公工具AI工具博思AIPPTAI生成PPT智能排版海量精品模板AI创作热门
潮际好麦

潮际好麦

AI赋能电商视觉革命,一站式智能商拍平台

潮际好麦深耕服装行业,是国内AI试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。

iTerms

iTerms

企业专属的AI法律顾问

iTerms是法大大集团旗下法律子品牌,基于最先进的大语言模型(LLM)、专业的法律知识库和强大的智能体架构,帮助企业扫清合规障碍,筑牢风控防线,成为您企业专属的AI法律顾问。

SimilarWeb流量提升

SimilarWeb流量提升

稳定高效的流量提升解决方案,助力品牌曝光

稳定高效的流量提升解决方案,助力品牌曝光

Sora2视频免费生成

Sora2视频免费生成

最新版Sora2模型免费使用,一键生成无水印视频

最新版Sora2模型免费使用,一键生成无水印视频

Transly

Transly

实时语音翻译/同声传译工具

Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。

讯飞绘文

讯飞绘文

选题、配图、成文,一站式创作,让内容运营更高效

讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。

热门AI辅助写作AI工具讯飞绘文内容运营AI创作个性化文章多平台分发AI助手
TRAE编程

TRAE编程

AI辅助编程,代码自动修复

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

AI工具TraeAI IDE协作生产力转型热门
商汤小浣熊

商汤小浣熊

最强AI数据分析助手

小浣熊家族Raccoon,您的AI智能助手,致力于通过先进的人工智能技术,为用户提供高效、便捷的智能服务。无论是日常咨询还是专业问题解答,小浣熊都能以快速、准确的响应满足您的需求,让您的生活更加智能便捷。

imini AI

imini AI

像人一样思考的AI智能体

imini 是一款超级AI智能体,能根据人类指令,自主思考、自主完成、并且交付结果的AI智能体。

下拉加载更多