/modelgym

Gym for predictive models

Primary LanguageJupyter NotebookApache License 2.0Apache-2.0

Model Gym

Gym for predictive models

run at everware

Installation

  1. Starting Virtual Environment
  2. Installing Dependences
  3. Verification If Model Gym Works Correctly

Installation With Docker

  1. Getting Started
  2. Running Model Gym In A Container Using DockerHub Image
  3. Verification If Model Gym Works Correctly

Installation

Note: This installation guide was written for python3

1. Starting Virtual Environment

Create directory where you want to clone this rep and switch to it. Install virtualenv and start it.

pip3 install virtualenv
python3 -m venv venv
source venv/bin/activate

To deactivate simply type deactivate

2. Installing Dependences

Install required python3 packages by running following commands.

  1. modelgym
    pip3 install git+https://github.com/yandexdataschool/modelgym.git
  2. jupyter, yaml, hyperopt, skopt, pandas and networkx
    pip3 install jupyter pyyaml hyperopt scikit-optimize pandas networkx==1.11
  3. LightGBM. Note: Modelgym works with LightGBM version 2.0.2
    git clone --recursive https://github.com/Microsoft/LightGBM
    cd LightGBM
    git checkout 80c641cd17727bebea613af3cbfe3b985dbd3313
    mkdir build && cd build && cmake -DUSE_MPI=ON ..
    make -j
    cd ../python-package/ && python3 setup.py install
    cd ../../
    rm -rf LightGBM
  4. XGBoost. Note: Modelgym works with XGBoost version 0.6.
    git clone --recursive https://github.com/dmlc/xgboost
    cd xgboost
    git checkout 14fba01b5ac42506741e702d3fde68344a82f9f0
    make -j
    cd python-package; python3 setup.py install
    cd ../../
    rm -rf xgboost

3. Verification If Model Gym Works Correctly

Clone repository.

git clone https://github.com/yandexdataschool/modelgym.git

Move to example and start jupyter-notebook.

cd modelgym/example
jupyter-notebook

Open model_search.ipynb and run all cells. If there are no errors, everything is allright!

Model Gym With Docker

1. Getting Started

To run model gym inside Docker container you need to have installed Docker (also for Mac or Windows you can install instead Kitematic).

Download this repo. All of the needed files are in the modelgym directory.

$ git clone https://github.com/yandexdataschool/modelgym.git
$ cd ./modelgym

2. Running Model Gym In A Container Using DockerHub Image

To run docker container with official image anaderi/modelgym:latest from DockerHub repo for using model gym via jupyter you simply run the command:

$  docker run -ti --rm  -v `pwd`:/src  -p 7777:8888 \
   anaderi/modelgym:latest  bash --login -ci 'jupyter notebook'

At first time it downloads container.

3. Verification If Model Gym Works Correctly

Firstly you should check inside container that /src is not empty.

To connect to jupyter host in browser check your Docker public ip:

$ docker-machine ip default

(usually it's 192.168.99.100)

When you start a notebook server with token authentication enabled (default), a token is generated to use for authentication. This token is logged to the terminal, so that you can copy it.

Go to http://<your published ip>:7777/ and paste auth token.

Open /example/model_search.ipynb and try to run all cells. If there are no errors, everything is allright.