Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix convert signature #80

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ To cite this repository:
author = {Davi Vieira and Gabriel Gimenez and Guilherme Marmerola and Vitor Estima},
title = {XGBoost Survival Embeddings: improving statistical properties of XGBoost survival analysis implementation},
url = {http://github.com/loft-br/xgboost-survival-embeddings},
version = {0.3.2},
version = {0.3.3},
year = {2021},
}
```
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "xgbse"
version = "0.3.2"
version = "0.3.3"
description = "Improving XGBoost survival analysis with embeddings and debiased estimators"
authors = ["Loft Data Science Team <[email protected]>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion xgbse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from ._meta import XGBSEBootstrapEstimator
from ._stacked_weibull import XGBSEStackedWeibull

__version__ = "0.3.2"
__version__ = "0.3.3"

__all__ = [
"XGBSEDebiasedBCE",
Expand Down
3 changes: 2 additions & 1 deletion xgbse/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def convert_y(y):
return y[event_field], y[time_field]


def convert_data_to_xgb_format(X, y, objective, enable_categorical: bool):
def convert_data_to_xgb_format(X, y, objective, enable_categorical: bool = False):
"""Convert (X, y) data format to xgb.DMatrix format, either using cox or aft models.

Args:
Expand All @@ -51,6 +51,7 @@ def convert_data_to_xgb_format(X, y, objective, enable_categorical: bool):
y (structured array(numpy.bool_, numpy.number)): binary event indicator as first field,
and time of event or time of censoring as second field.
objective (string): one of 'survival:aft' or 'survival:cox'
enable_categorical (bool): whether to enable categorical features - default is False

Returns:
xgb.DMatrix: data to train xgb
Expand Down