Public Repository

Last pushed: 2 years ago
Short Description
An image with the dependencies setup to visualize a decision tree.
Full Description


I created this to help folks who had trouble configuring pydot or Graphviz in episode 2. This is a personal project and not a product of Google. License: Apache 2.0.


First install docker, following the instructions here.

After you've installed docker:

$ docker run -it jbgordon/recipesv1

This will download and run the docker image. Note, the image is a bit large, since I included the kitchen sink.

Inside the container, you can then run:

# python

to run the sample code for episode 2 that generates the PDF.

To view the PDF, you can copy it out of the container to your host machine. To do that, we'll need to mount a local directory inside the container. First, exit docker by typing:

# exit

Now we'll start docker using a command line argument to mount a local directory, so we can copy files between the container and the host machine. This command will connect /your/directory on the host machine to /foo in the container.

$ docker run -it -v /your/directory:/foo jbgordon/recipesv1

Inside the container, you can then run:

# python

Then copy the PDF to the host machine.

# cp iris.pdf /foo

Which places it in /your/directory. Now you can open and view it as usual.

Here's the Dockerfile if you'd like to build this on your own.


RUN pip install --upgrade pip
RUN apt-get update
RUN apt-get install -y graphviz libgraphviz-dev pkg-config
RUN pip install pygraphviz
RUN apt-get install -y python-scipy
RUN pip install pydot
RUN pip install sklearn

Docker Pull Command