An open API service indexing awesome lists of open source software.

https://github.com/henrytseng/example_docker_scikit-learn

A quick example of using Scikit-Learn from a Docker container
https://github.com/henrytseng/example_docker_scikit-learn

docker scikit-learn

Last synced: about 2 months ago
JSON representation

A quick example of using Scikit-Learn from a Docker container

Awesome Lists containing this project

README

          

# README.md

## Setup

Get Docker https://store.docker.com/

* MacOSX https://store.docker.com/editions/community/docker-ce-desktop-mac?tab=description

Check installation; you may need to use `sudo` depending on what environment/version-of-docker-machine you're running

Make sure your Docker service is running.

```
docker --version
```

Build container `Dockerfile`

```
docker build -t myjupyter .
```

Check image exists

```
docker images
```

## Run

Start container

```
docker run -p 8888:8888 -v "`pwd`/notebook":/notebook -i -t myjupyter
```

Check container is running

```
docker ps
```

Create the data set of 100k examples

pushd notebook/data/; ./create_example.rb --limit 100000 --do_write; popd
Direct your browser using the token given to you in the terminal window

http://localhost:8888/?token=49f039d31855ab1c6247201be0cb742499f34e8b14f01cc6

Check your environment with `notebook/check_env.ipynb`

Open up the notebook `notebook/01 - Example.ipynb` to take a look at the example.

## Shutdown

Get the container ID

```
docker ps
```

Remove the container (e.g. - if the container ID is `1fa4ab2cf395`)

```
docker kill 1fa4ab2cf395
```

Get a list of images

```
docker images
```

Remove image (e.g. - if the image ID is `1fa4ab2cf395`)

```
docker rmi 1fa4ab2cf395
```

## Debug

To explore container -- run interactive `/bin/bash` directly on the image

```
docker exec -i -t 516c87927968 /bin/bash
```