$npx skillfedfor your agent

imbalance-xgboost

XGBoost for label-imbalanced data: XGBoost with weighted and focal loss functions

With conditionsPyPI Artificial IntelligenceReleased Feb 2021151.2K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — imbalance_xgboost-0.8.1-py3-none-any.whl
v0.8.1 · released 2021-02-08 · 3 runtime deps: numpy, scikit-learn, xgboost

Yes, if you need focal or weighted loss for XGBoost on imbalanced binary classification and are willing to test compatibility with your XGBoost version. The package has low install friction and permissive licensing. However, dormancy since 2021 means no active maintenance, so verify it works with your current environment before relying on it in production.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires xgboost >= 1.1.1 as of version 0.8.1; package was tested on Python 3.5 and 3.6 with incomplete testing on 3.7 and 3.8.
  • Low friction installation with three core dependencies (numpy, scikit-learn, xgboost).
  • Package is dormant—last release was in February 2021, so expect no active maintenance or updates.

License · maintenance · safety

MIT (permissive) — MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions, making it safe for most projects.

last release 2021-02-08 (2013 days) · last repo commit 2024-02-14 · 341 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 151,179 downloads/mo, #10,940 on PyPI

Verify before relying

pip install imbalance-xgboost
from imbalance_xgboost import imbalance_xgboost
model = imbalance_xgboost(special_objective='focal')
model.fit(X_train, y_train)
predictions = model.predict_sigmoid(X_test)
  • Compatibility with Python versions beyond 3.8 and current XGBoost releases (last tested in early 2021).
  • Whether early stopping feature (added in 0.8.1) works reliably with recent XGBoost versions.
  • Real-world performance gains compared to XGBoost's native scale_pos_weight or other imbalance handling methods.
Same gist for agents: .md · .json

What it is and what it does

Imbalance-XGBoost is a wrapper around XGBoost that implements weighted and focal loss functions for binary classification on imbalanced datasets. The package handles the mathematical complexity of computing first and second-order gradients required by XGBoost's custom loss interface, so you can use these loss functions without deriving the math yourself. It exposes the loss choice via a `special_objective` parameter and allows tuning of the imbalance factor (α) and focal parameter (γ) at initialization.

The wrapper is designed to be compatible with scikit-learn's API, so you can use it with GridSearchCV and other sklearn utilities for hyperparameter tuning. It provides multiple prediction methods (raw logits, sigmoid probabilities, binary class labels, and two-class probability distributions) and includes evaluation functions for metrics like accuracy, precision, recall, F1, and confusion matrix components. However, the package has not been actively maintained since February 2021, and its compatibility with modern Python and XGBoost versions is untested.

Use it for

  • Tuning focal loss hyperparameters (γ) on imbalanced binary datasets using GridSearchCV.
  • Comparing weighted loss (α) versus focal loss on the same imbalanced classification problem.
  • Integrating custom loss functions into scikit-learn pipelines and cross-validation workflows.
  • Evaluating classification performance on imbalanced data using confusion matrix metrics.
  • Training boosted models when one class is significantly underrepresented in the training set.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need focal or weighted loss for XGBoost on imbalanced binary classification and are willing to test compatibility with your XGBoost version.

The package has low install friction and permissive licensing. However, dormancy since 2021 means no active maintenance, so verify it works with your current environment before relying on it in production.

Install

imbalance-xgboost on PyPI

Before you install

Low friction installation with three core dependencies (numpy, scikit-learn, xgboost). Package is dormant—last release was in February 2021, so expect no active maintenance or updates.

Requires xgboost >= 1.1.1 as of version 0.8.1; package was tested on Python 3.5 and 3.6 with incomplete testing on 3.7 and 3.8.

License in practice

MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions, making it safe for most projects.

Quickstart

pip install imbalance-xgboost
from imbalance_xgboost import imbalance_xgboost
model = imbalance_xgboost(special_objective='focal')
model.fit(X_train, y_train)
predictions = model.predict_sigmoid(X_test)

Verify before relying

  • Compatibility with Python versions beyond 3.8 and current XGBoost releases (last tested in early 2021).
  • Whether early stopping feature (added in 0.8.1) works reliably with recent XGBoost versions.
  • Real-world performance gains compared to XGBoost's native scale_pos_weight or other imbalance handling methods.

Package facts

LicenseMIT permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependencies
3 packages
numpyscikit-learnxgboost
MaintenanceDormant 2,013 days since the last release
Last repo commit
First released
Downloads151,179 / month, #10,940 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Intended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6

Evidence: imbalance_xgboost-0.8.1-py3-none-any.whl

Tags

Capabilities
xgboost imbalanced datafocal loss binary classificationweighted loss xgboostclass imbalance handlingxgboost custom loss functionimbalanced dataset classifierxgboost label imbalance
Topics
imbalanced-classificationgradient-boostingsklearn-compatible

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “xgboost imbalanced data”

  • imbalance-xgboostWraps XGBoost with weighted and focal loss functions to handle binary…
  • imblearnThis package is a deprecated stub that redirects users to install…
  • xgboost-rayDistributes XGBoost training and inference across multiple nodes and…

Give your agent the search over MCP, or paste the wish link into any chat.

More Artificial Intelligence packages

litellm With conditions
PyPI · Artificial Intelligence · released Aug 2026

LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.

Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.

MITcompiled wheel
682.8Mdownloads / mo
huggingface-hub Worth it
PyPI · Artificial Intelligence · released Aug 2026

Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.

Install it if you work with Hugging Face Hub models or datasets.

Apache-2.0pure Python · 3.10.0+
442.4Mdownloads / mo
langchain Worth it
PyPI · Python Modules · released Aug 2026

LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.

MITpure Python
315.4Mdownloads / mo
hf-xet With conditions
PyPI · Artificial Intelligence · released Aug 2026

hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.

Apache-2.0compiled wheel · 3.8+
258.4Mdownloads / mo
tokenizers Worth it
PyPI · Artificial Intelligence · released Apr 2026

Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.

Apache-2.0compiled wheel · 3.10+
222.9Mdownloads / mo
transformers Worth it
PyPI · Artificial Intelligence · released Aug 2026

Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.

Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.

permissive licensepure Python · 3.10.0+
186.6Mdownloads / mo

See also imbalanced-learn · xgboost-cpu · imblearn · xgboost · dtreeviz · catboost · pytorch-metric-learning · sklearn-crfsuite · xgboost-ray · geomloss