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

Kaggle Best Practices #3

Open
1 task
westurner opened this issue Dec 15, 2016 · 2 comments
Open
1 task

Kaggle Best Practices #3

westurner opened this issue Dec 15, 2016 · 2 comments

Comments

@westurner
Copy link
Member

westurner commented Dec 15, 2016

  • Research Kaggle Best Practices
@westurner
Copy link
Member Author

westurner commented Dec 15, 2016

Research kaggle best practices

So, a git repository which will be cloned or mounted in a docker container (as /kaggle with kaggle/docker-python):

  • Dockerfile
    • (FROM continuumio/anaconda3:latest)
    • FROM kaggle/docker-python:latest
    • # RUN conda env update -f=/kaggle/src/[repo/]environment.yml
  • input/ -- data {data_description.txt, train.csv, test.csv, }
  • src/
    • src/train.py
    • src/predict.py
    • src/repo -- git submodule(s)?
      • src/repo/environment.yml
      • src/repo/Makefile
  • working/ -- output {trained models, predicted data, logs}
    • working/ should be added and then .gitignore'd to prevent uploading

[ ] How to handle multiple organization users' approaches with everything in src/?

  • git submodules
    • src/repo -- submodule
    • https://github.com/blog/2104-working-with-submodules
    • what about output in working/ ?
      • how to track which code produced which prediction.csv?
        • nothing in working/ should be checked in or shared (at least until after the competition closes)
        • as a team, we commit to always store the commit hash for the entered solution?
          • cd src/..
            git commit
            git rev-parse --short HEAD | tee SUBMISSION_PATH/shortrev.txt;
                cd working/;
            python ../src/train.py;    # > MODEL_PATH/
            python ../srcpredict.py;  # > SUBMISSION_PATH/
               # post (shortrev.txt, prediction.csv, train_MSE) to {Slack,?}
               # post prediction.csv to <https://#kaggle_competition>

@westurner
Copy link
Member Author

westurner commented Dec 15, 2016

From http://blog.kaggle.com/2016/02/05/how-to-get-started-with-data-science-in-containers/ :

kpython(){
  docker run -v $PWD:/tmp/working -w=/tmp/working --rm -it kaggle/python python "$@"
}
ikpython() {
  docker run -v $PWD:/tmp/working -w=/tmp/working --rm -it kaggle/python ipython
}
kjupyter() {
  (sleep 3 && open "http://$(docker-machine ip docker2):8888")&
  docker run -v $PWD:/tmp/working -w=/tmp/working -p 8888:8888 --rm -it kaggle/python jupyter notebook --no-browser --ip="\*" --notebook-dir=/tmp/working
}
  • What's a good solution for working with an IDE which supports code-completion which needs filesystem access to the installed libraries within a container?

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

No branches or pull requests

1 participant