Has anyone been able to implement a conditional logistic?


I’m wondering if anyone has been able to implement a conditional logistic solution in XGBoost (even for 1:m matching) - either through transforming data to fit one of the existing objective functions, or creating a custom objective function?

I understand that there is the rank:pairwise objective function but I wanted to avoid this function for two reasons:

  • It doesn’t allow for cross-validation as it cannot handle having the ‘group’ information being populated

  • The output of the rank:pairwise is open to interpretation - I need to the output to be the conditional probability within a group, whereas am I led to understand the output of this model is just some type of raw score used solely for ranking within a group.

Conditional logistic has similarities to both multi:softmax and survival:cox. From what I understand about multi:softmax though it deals with multiple outcome possibilities for each record, whereas I need one successful case across several records in each group. I keep reading the conditional logistic is kind of like a special case of survival:cox but I am unsure of how to pass the ‘group’ index through to the survival:cox function.

Is it possible somehow to pass the group ID through to a custom objective function? I see that the get.info for ‘group’ doesn’t work for a DMatrix so I am not sure of the most efficient way to do this.

I’d be extremely grateful if anyone has pointers on how best to approach this.

Kind regards,


There is a pull request to expose group information from DMatrix: https://github.com/dmlc/xgboost/pull/3566. Would this be helpful to your case?


Yes I imagine that would be a good place to start - if the group information can be passed into a custom objective function and eval function then it’s possible this could work. Many thanks!


Just wondering do you know if exposing the group information will allow it to be passed through to Cross-Validation and the like? Currently objectives such as rank:pairwise do not work with cross-validation as the group information cannot be passed through


Hi, Is there any progress to attempt to replicate the conditional logistic model in XGBoost?
Kind Regards