{"id":23188,"library":"xgbse","title":"XGBoost Survival Embeddings","description":"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).","status":"active","version":"0.3.3","language":"python","source_language":"en","source_url":"https://github.com/loft-br/xgboost-survival-embeddings","tags":["survival-analysis","xgboost","embedding","kaplan-meier"],"install":[{"cmd":"pip install xgbse","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"Core dependency for model training","package":"xgboost","optional":false},{"reason":"Used for evaluation metrics like concordance index","package":"lifelines","optional":false},{"reason":"Numerical computations","package":"numpy","optional":false},{"reason":"Data handling","package":"pandas","optional":false},{"reason":"Utility functions","package":"scikit-learn","optional":false}],"imports":[{"note":"Top-level import changed; models are directly under xgbse in recent versions.","wrong":"from xgbse.models import XGBSEKaplanNeighbors","symbol":"XGBSEKaplanNeighbors","correct":"from xgbse import XGBSEKaplanNeighbors"}],"quickstart":{"code":"import pandas as pd\nfrom xgbse import XGBSEKaplanNeighbors\nfrom xgbse.metrics import concordance_index\n\n# sample data\ndf = pd.DataFrame({\n    'duration': [5, 8, 3, 6],\n    'event': [1, 1, 1, 0],\n    'feature1': [0.5, 0.2, 0.9, 0.4]\n})\nX = df[['feature1']]\ny = df[['duration', 'event']]\n\nmodel = XGBSEKaplanNeighbors()\nmodel.fit(X, y)\npreds = model.predict(X)\nprint(concordance_index(y['duration'], y['event'], preds))","lang":"python","description":"Basic survival model with XGBSEKaplanNeighbors and concordance index evaluation."},"warnings":[{"fix":"Use 'from xgbse import XGBSEKaplanNeighbors' instead of 'from xgbse.models import XGBSEKaplanNeighbors'","message":"API change in v0.3.x: model classes moved from xgbse.models to top-level xgbse. Old imports break.","severity":"breaking","affected_versions":"v0.2.x -> v0.3.x"},{"fix":"Replace 'compute_ci' with 'concordance_index'.","message":"The function 'xgbse.metrics.compute_ci' is deprecated and will be removed in v0.4. Use 'concordance_index' from the same module.","severity":"deprecated","affected_versions":"v0.3.x"},{"fix":"Pass y = df[['duration', 'event']] explicitly, not just multiple columns.","message":"If 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.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.3.3':22 '2024':33 '3.9':25 'analysi':9,36 'base':17 'current':20 'debias':12 'earli':32 'embed':3,16,38 'embedding-bas':15 'estim':13 'extract':19 'featur':18 'improv':5 'infrequ':29 'kaplan':40 'kaplan-mei':39 'last':30 'meier':41 'provid':11 'python':24 'releas':28 'support':23 'surviv':2,8,35 'survival-analysi':34 'updat':31 'version':21 'xgboost':1,6,37 'xgbse':4","created_at":"2026-05-01T06:02:53.341888+00:00","updated_at":"2026-05-01T06:02:53.341888+00:00","problems":[{"fix":"Correct usage: model = XGBSEKaplanNeighbors(n_neighbors=100)","cause":"XGBSEKaplanNeighbors expects 'n_neighbors' during init, but if you pass it as a positional argument or misspell it, you get this error.","error":"TypeError: __init__() got an unexpected keyword argument 'n_neighbors'"},{"fix":"Use 'from xgbse import XGBSEKaplanNeighbors'","cause":"Starting from v0.3.x, models are no longer in xgbse.models but directly in xgbse.","error":"ImportError: cannot import name 'XGBSEKaplanNeighbors' from 'xgbse.models'"},{"fix":"Run 'pip install xgbse' to install.","cause":"Library not installed or installed in a different environment.","error":"ModuleNotFoundError: No module named 'xgbse'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.3.3","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/loft-br/xgboost-survival-embeddings","docs":null,"changelog":null,"pypi":"https://pypi.org/project/xgbse/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}