Registry / ai-ml / xgbse
library0.3.3pypypi✓ verified 88d ago

xgbse improves XGBoost for survival analysis by providing debiased estimators and embedding-based feature extraction. Current version 0.3.3 supports Python >=3.9 and is released infrequently (last updated early 2024).

pip install xgbse
INSTALL
IMPORT
SIG · XGBSE
X
xgbse
ai-mlpythonv0.3.3
Install
31.2s avg
Import
4422ms
Disk
1229MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.3.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 30.9s
py 3.11
✕ build_error
✓ 29.4s
py 3.12
✕ build_error
✓ 30.3s
py 3.13
✕ build_error
✕ build_error
py 3.9
✕ build_error
✓ 34.3s
1229MB installed
● package 1229MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

XGBSEKaplanNeighbors
✓ from xgbse import XGBSEKaplanNeighbors
✗ from xgbse.models import XGBSEKaplanNeighbors
Top-level import changed; models are directly under xgbse in recent versions.

Basic survival model with XGBSEKaplanNeighbors and concordance index evaluation.

import pandas as pd from xgbse import XGBSEKaplanNeighbors from xgbse.metrics import concordance_index # sample data df = pd.DataFrame({ 'duration': [5, 8, 3, 6], 'event': [1, 1, 1, 0], 'feature1': [0.5, 0.2, 0.9, 0.4] }) X = df[['feature1']] y = df[['duration', 'event']] model = XGBSEKaplanNeighbors() model.fit(X, y) preds = model.predict(X) print(concordance_index(y['duration'], y['event'], preds))
Debug
Known issues
breakingAPI change in v0.3.x: model classes moved from xgbse.models to top-level xgbse. Old imports break.
fix
Use 'from xgbse import XGBSEKaplanNeighbors' instead of 'from xgbse.models import XGBSEKaplanNeighbors'
affects: v0.2.x -> v0.3.x
deprecatedThe function 'xgbse.metrics.compute_ci' is deprecated and will be removed in v0.4. Use 'concordance_index' from the same module.
fix
Replace 'compute_ci' with 'concordance_index'.
affects: v0.3.x
gotchaIf you pass a pandas DataFrame with columns named 'duration' and 'event', xgbse expects them to be in that order. If your DataFrame has additional columns, ensure the target is correctly specified.
fix
Pass y = df[['duration', 'event']] explicitly, not just multiple columns.
affects: all
Errors
Common errors & fixes
TypeError: __init__() got an unexpected keyword argument 'n_neighbors'
XGBSEKaplanNeighbors expects 'n_neighbors' during init, but if you pass it as a positional argument or misspell it, you get this error.
fix
Correct usage: model = XGBSEKaplanNeighbors(n_neighbors=100)
ImportError: cannot import name 'XGBSEKaplanNeighbors' from 'xgbse.models'
Starting from v0.3.x, models are no longer in xgbse.models but directly in xgbse.
fix
Use 'from xgbse import XGBSEKaplanNeighbors'
ModuleNotFoundError: No module named 'xgbse'
Library not installed or installed in a different environment.
fix
Run 'pip install xgbse' to install.
Upgrade
Version history
0.3.3latest on PyPI · released Oct 3, 2024
Audit
Dependencies
xgboostrequiredCore dependency for model training
lifelinesrequiredUsed for evaluation metrics like concordance index
numpyrequiredNumerical computations
pandasrequiredData handling
scikit-learnrequiredUtility functions
Agent activity
32 hits · last 30 days
node
26
OpenAI (training)
1
Resources
xgbse — pip install xgbse · libregistry