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

Feature Request: Boosted Conditional Logit #17

Open
seandickert opened this issue Nov 30, 2017 · 8 comments
Open

Feature Request: Boosted Conditional Logit #17

seandickert opened this issue Nov 30, 2017 · 8 comments

Comments

@seandickert
Copy link

Not sure if this branches too far from the intended purpose of the package, but boosted conditional logit models as described in "Shi, H., Yin, G., Boosting conditional logit model". R package located here: https://github.com/cran/clogitboost

@timothyb0912
Copy link
Owner

Boosted conditional logit is definitely close to the intended purpose of this package. I don't have bandwidth to take this on at the moment, but I'm happy to help out on a PR if you take an initial shot at implementing it.

@csaiedu
Copy link

csaiedu commented Jan 8, 2019

Hi Timothy, from your expert opinion do you think this can be done using the new Cox PH survival:cox objective function? I know clogit is a special case of cox ph, but I need to understand the setup of the strata fully.

@timothyb0912
Copy link
Owner

Hey @csaiedu, I haven't looked at the new Cox PH survavl:cox objective function. It's possible that it could be used.

My gut feeling is that an implementation based on https://github.com/dswah/pyGAM might be the fastest way to get boosted conditional logit working in pylogit. Note, my opinion is based on the fact that (1) the original paper by Shi and Yin bases their implementation on smoothing splines and (2)pyGAM looks like its the best developed implementation for using smoothing splines in generalized linear models (which includes most models in PyLogit).

@csaiedu
Copy link

csaiedu commented Jan 11, 2019

Thank you Timothy I appreciate the feedback. I'll dig into this.
Kind Regards

@seandickert
Copy link
Author

I've actually taken a stab at this and implemented it in python using a pylogit. Unfortunately, I couldn't find a smoothing spline implementation in python which could reproduce the results from the paper. So, I call R's smooth.spline object. I can take a look at pyGAM and if I can use that in stead, I'll submit a PR

@timothyb0912
Copy link
Owner

timothyb0912 commented Apr 4, 2019

@seandickert that would be incredible if you could get a python implementation working. How did attempting to use pyGAM go?

Also, did you succeed in reproducing the paper's results using R's smooth.spline object? Am I correct to assume you were using something like r2py to combine pylogit and R?

@seandickert
Copy link
Author

Haven't tried with pyGAM yet, but plan to within the next week or so.

Correct, I used r2py. This was about a year ago, so I can't recall if I used the dataset that the paper did or my own. However, I trained 2 models: one using just the authors' R package and one using my own implementation that was primarily python with just the calls to smooth.spline in R. The final likelihood and coefficients were the same for each.

@csaiedu
Copy link

csaiedu commented Jun 30, 2019

Hi Timothy. A version of conditional logit with xgboost has emerged. In case you missed it: https://discuss.xgboost.ai/t/support-for-left-truncated-data-time-dependent-covariates-for-cox-regression/651
Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants