TransmogrifAI Samples on Jupyter

In this section we will look at how TransmogrifAI can be run within Scala notebooks on Jupyter.

We are going to leverage [BeakerX](http://beakerx.com/) Scala kernel for Jupyter

Setup BeakerX on Linux / Ubuntu

Prequisities :

  • Apache Maven
  • Python 3
  • JDK 8

Installation using pip

Installation using conda

Reference : beakerx_docs

Setup BeakerX on Mac with Docker

BeakerX provides a beakerx_docker image on docker hub.

Clone the code

Sample notebooks are stored in the repo https://github.com/rajdeepd/transmogrifai-samples

git clone git@github.com:rajdeepd/transmogrifai-samples.git

Assuming your Transmogrify source code is downloaded at /Users/rdua/work/github/rajdeepd/transmogrifai-samples.

We need the directory above so that we can mount sample notebooks and dataset into the container using docker volumes.

Increase the RAM available to Docker container

Mac Users

Increase the Memory available to docker containers from the docker UI as shown below

../_images/docker_memory_settings.png

Ubuntu Users

Increase the the Memory available using docker command with –memory 6g while creating the docker containe, refer to the section Run the beakerx Container below

Set TM_SAMPLE_PATH

export TM_SAMPLE_PATH=<transmogrifai-sample directory>

Run the beakerx Container

Mac

docker run -p 8888:8888 -v $TM_SAMPLE_PATH/:/home/beakerx/transmogrifai-samples  \
      --name transmogrifai-container-1 beakerx/beakerx

Ubuntu

docker run -p 8888:8888 -v $TM_SAMPLE_PATH/:/home/beakerx/transmogrifai-samples \
      --memory 6g --name transmogrifai-container-1 beakerx/beakerx

Trouble Shooting

In case you don’t see transmogrifai-samples folder in your home page, you can upload the notebooks manually and
run the notebooks.

Comamnds above will download the image (which takes a few minutes first time) and start the container. It will also publish the url and the token to access the container

Sample url is shown : http://localhost:8888/?token=<sometoken>

On opening the image in the browser you will notice that in the home page

../_images/transmogrifai-samples_home.png

Sample Notebooks

Following notebooks are currently available

Simple Regression Notebook

../_images/simple_regression.png

Next Steps

Run the Simple Regression notebook. Open the notebook at the following url or navigate from within Jupyter UI.

http://localhost:8888/notebooks/transmogrifai-samples/notebooks/Simple_Regression.ipynb

Run each cell manually or from the navigaiton menue press Cell –> Run All