[DOCKER] Learn machine learning anytime, anywhere in an on-demand Jupyter Notebook environment

Recently, I've been completely immersed in machine learning, but using Jupyter Notebook is useful because it makes my studies easier. Since it can be used with a browser, I wanted an environment where I could open my "notebook" even if I didn't have my favorite laptop, anytime and anywhere with a browser.


Overview

Build a Jupyter Notebook environment with Docker on DigitalOcean To do.

DigitalOcean is a cheap so-called IaaS. It is charged on an hourly basis and can be used for 0.86 yen / hour ($ 0.007 / hour) as of November 21, 2015. If you turn off the server on the DigitalOcean web page, it will not cost you money, so you can turn it on only when you want to study.

Docker is a well-known container-type application deployment tool, which is used here to simplify the construction of the Jupyter Notebook environment. As a container, scikit-learn etc. is pre-installed here Container is used.

Environment

Creating a Droplet

DigitalOcean builds a server in units called Droplets.

As a prerequisite, once you have created a DigitalOcean account, follow the this article to get your public key. I will register it.

  1. Log in to DigitalOcean and click "Create Droplet"

  2. Create a Droplet with the following content (Choose an image selects Docker)

Deploy Jupyter container

  1. When the Droplet creation is completed, the IP address of the created Droplet will be displayed. Log in to Droplet with ssh from your PC.

    $ ssh root@<IP address>
    
  2. Create a workspace directory [^ 1]

    $ mkdir /opt/notebooks #Location is arbitrary
    $ chmod a+w -R /opt/notebooks
    
  3. Start the Jupyter container that contains the packages required for machine learning such as scikit-learn.

    $ docker run -d --restart always -p 8888:8888 -v /opt/notebooks:/home/jovyan/work -e PASSWORD=<Any password> jupyter/datascience-notebook
    
  4. Go to http: // <IP address>: 8888 in your browser to check

[^ 1]: I'm trying to manage / opt / notebooks with git


After that, try using Jupyter Notebook as usual. When you're done, try "Power off" from the DigitalOcean Web. If you "Power on" later, Jupyter Notebook will start up automatically.

Once upon a time, I was wondering, "The ʻorg mode of ʻEmacs is suitable for writing sentences, but is it something that can't easily execute program code or even reflect the results?" However, I think Jupyter Notebook is a tool that makes this possible. In that sense, I think that the current students are happy, and I think it would be good to actively introduce Jupyter Notebook at school these days.

Recommended Posts

Learn machine learning anytime, anywhere in an on-demand Jupyter Notebook environment
Machine learning with Jupyter Notebook in OCI Always Free environment (2019/12/17)
Build an interactive environment for machine learning in Python
Create an arbitrary machine learning environment with GCP + Docker + Jupyter Lab
Error running Jupyter Notebook in Anaconda virtual environment
Try using Jupyter Notebook of Azure Machine Learning
Easy Machine Learning with AutoAI (Part 4) Jupyter Notebook Edition
Somehow learn machine learning
Run pandas-highcharts display_charts in an environment other than jupyter
How to build Anaconda virtual environment used in Azure Machine Learning and link with Jupyter
Rebuilding an environment for machine learning with Miniconda (Windows version)
[Machine learning] Let's summarize random forest in an easy-to-understand manner
Build an environment for machine learning using Python on MacOSX
Reflect the virtual environment created with Miniconda in Jupyter notebook
Building an auto-sklearn environment that semi-automates machine learning (Mac & Docker)
An introduction to machine learning
Display HTML in Jupyter notebook
Multiprocessing error in Jupyter Notebook
Machine learning environment construction macbook 2021
Build a machine learning environment
Used in machine learning EDA
python3.8 venv environment jupyter notebook
How to quickly create a machine learning environment using Jupyter Notebook on macOS Sierra with anaconda
How about Anaconda for building a machine learning environment in Python?
Perform morphological analysis in the machine learning environment launched by GCE
Jupyter Notebook 6.0.2 cannot be installed in the Python 2.7 environment created in Anaconda
Python machine learning without the need for a development environment. In Azure notebook (jupyter notebook on Azure), "Let's learn by programming with Ayaka Ikezawa! I took a mathematics course for machine learning [Bayes' theorem]
Automate routine tasks in machine learning
Generate Jupyter notebook ".ipynb" in Python
Classification and regression in machine learning
[MEMO] [Development environment construction] Jupyter Notebook
Machine learning in Delemas (data acquisition)
View graphs inline in Jupyter Notebook
Python: Preprocessing in Machine Learning: Overview
Preprocessing in machine learning 2 Data acquisition
Created an environment for Anaconda & Jupyter
Random seed research in machine learning
Preprocessing in machine learning 4 Data conversion
You will be an engineer in 100 days ――Day 81 ――Programming ――About machine learning 6
[Definitive Edition] Building an environment for learning "machine learning" using Python on Windows
You will be an engineer in 100 days ――Day 82 ――Programming ――About machine learning 7
You will be an engineer in 100 days ――Day 79 ――Programming ――About machine learning 4
[Definitive Edition] Building an environment for learning "machine learning" using Python on Mac
Error "Entry point not found" when starting Jupyter Notebook in virtual environment
You will be an engineer in 100 days ――Day 76 ――Programming ――About machine learning
You will be an engineer in 100 days ――Day 80 ――Programming ――About machine learning 5
You will be an engineer in 100 days ――Day 78 ――Programming ――About machine learning 3
You will be an engineer in 100 days ――Day 84 ――Programming ――About machine learning 9
You will be an engineer in 100 days ――Day 83 ――Programming ――About machine learning 8
You will be an engineer in 100 days ――Day 77 ――Programming ――About machine learning 2
You will be an engineer in 100 days ――Day 85 ――Programming ――About machine learning 10