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

Saving multiple versions of xgb models #734

Closed
wants to merge 10 commits into from
Closed

Conversation

glr72
Copy link

@glr72 glr72 commented Jan 11, 2016

Hi,

the small change below allows to save more than 1 version of the model (in the main xgb.train.R it is always overwritten).

@terrytangyuan
Copy link
Member

@glr72 Thanks but some people might want to only save 1 version though. It would be better if, instead, you can add a parameter max_to_keep for the maximum number of recent models to keep. The idea is that people want to save only several versions of the recent models. I am open to other ideas though.

@glr72
Copy link
Author

glr72 commented Jan 11, 2016

hi terrytangyuan,

I implemented your proposal. You have parameter max_to_keep (default = 0), which works as you suggested.

@terrytangyuan
Copy link
Member

@glr72 Thank you. Could you squash your commits into one and add yourself to CONTRIBUTORS?

@glr72
Copy link
Author

glr72 commented Jan 12, 2016

Hi terrytangyuan,
sure. Can you please teach me how to do it? Thanks

@terrytangyuan
Copy link
Member

There are many ways to do this but here's one that's on top of my mind and you can just copy and paste.

git reset --soft HEAD~5 # move head to 5 commits before and keep the changes
git add -A # add all the changes to stage
git commit -m "Added max_to_keep parameter" # commit message
git push --force origin master # do a force push to your master branch since you are changing commit history

For your reference, you should look into how to use git rebase from command line or use it in sourceTree (http://blogs.atlassian.com/2014/06/interactive-rebase-sourcetree/). Let me know if you have any questions.

@glr72
Copy link
Author

glr72 commented Jan 13, 2016

Ok I did it. There's a problem with the CONTRIBUTOR file but it looks to be not relevant.

@terrytangyuan
Copy link
Member

Good job! Looks like it has conflicts with CONTRIBUTORS. Could you resolve it or do a

git reset --hard HEAD~1
git push --force origin master

and I'll add you there myself.

Thanks!

@glr72
Copy link
Author

glr72 commented Jan 13, 2016

commands executed (actually --forcec and not --hard)

Thanks again

@glr72 glr72 reopened this Jan 13, 2016
@terrytangyuan
Copy link
Member

@glr72 I don't see any changes though. Mind trying it again?

@tqchen tqchen closed this Feb 28, 2016
@tqchen
Copy link
Member

tqchen commented Feb 28, 2016

closing this PR for now and refer to #892 for new guidelines with respect to adding these related features

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

Successfully merging this pull request may close these issues.

3 participants