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

Allowing arbitrary names for setinfo in R #1431

Closed
hetong007 opened this issue Aug 2, 2016 · 4 comments
Closed

Allowing arbitrary names for setinfo in R #1431

hetong007 opened this issue Aug 2, 2016 · 4 comments

Comments

@hetong007
Copy link
Member

I had a discussion with @road2stat about introducing Cox regression into xgboost. The special thing about it is that in the loss function there are some additional parameters (similar to weights).

The function setinfo enables user to set certain numerical information for each data point in an xgb.DMatrix object. In its current implementation, we only have four options for the parameter name.

@tqchen May I know the reason for that restriction? If we could remove the restriction for the names, Users could attach arbitrary parameters to the data points and it will be more flexible for the loss function implementation. This helps some applications like Cox regression.

@nanxstats
Copy link

Thanks Tom. It would be great if we could somehow relax this restriction a little. I could also do it by whitelisting new names in setinfo.xgb.DMatrix etc., but not sure if it's good practice touching the internal functions.

@khotilov
Copy link
Member

khotilov commented Aug 5, 2016

At R level, you can create a custom objective implemented as a closure that would keep censoring or any other data associated with labels (as @tqchen replied to my suggestion at #574 ).

@nanxstats
Copy link

@khotilov thanks for the hint, do you have any example code, by any chance?

I do think using closure here will help, but I'm not too sure if that's the best way to do this at R level without complicating things unnecessarily.

@pommedeterresautee
Copy link
Member

Here is an example of custom loss (no use of closure solution, but easy to guess how to do it)

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants