[PYTHON] Building an auto-sklearn environment that semi-automates machine learning (Mac & Docker)

What is auto-sklearn?

A library that can semi-automate machine learning preprocessing, algorithm selection, and hyperparameter search. See below for a detailed explanation.

What is auto-sklearn? Automate machine learning with WPython auto sklearn Data analysis with Python: Automation of machine learning

Building an auto-sklearn environment on mac

As a premise, auto-sklearn is developed on Ubuntu, and it seems that it works on Linux but may not work on Mac or Window. I can install it with pip, but I got moss on my PC many times (sweat)

Therefore, this time I would like to use Docker to build an environment where auto-sklearn can be tried quickly on MacOS.

environment

macOS Sierra 10.12.6

Docker installation

[For beginners] Create a development environment with Docker for Mac (up to container-to-container cooperation between application server and DB server)

Refer to here, Get started with Docker for Mac Install Docker from.

スクリーンショット 2017-08-23 13.58.00.png After installation, there is a Docker mark at the top of the window, and if it is running, it can be installed normally.

Next, download and launch the Docker image from the Docker hub. This time I used the following. felixleung/auto-sklearn

docker run -it -p 8888:8888 felixleung/auto-sklearn

Once you check the contents of the Docker image, it looks like this.

FROM ubuntu

# System requirements
RUN apt-get update && apt-get install -y \
  build-essential \
  curl \
  git \
  python3-pip \
  swig \
  && rm -rf /var/lib/apt/lists/*

# Upgrade pip then install dependencies
RUN pip3 install --upgrade pip
RUN curl https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt \
  | xargs -n 1 -L 1 pip3 install

# Install
RUN pip3 install git+https://github.com/automl/auto-sklearn
RUN pip3 install jupyter

At this point, I can run Python in the terminal, but I got a guts re-error when I tried to use jupyter because it was a big deal ...

root@99a82fa3566a:~# jupyter notebook                       
Traceback (most recent call last):
  File "/usr/local/bin/jupyter-notebook", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.5/dist-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/traitlets/config/application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "/usr/local/lib/python3.5/dist-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/notebook/notebookapp.py", line 1296, in initialize
    self.init_webapp()
  File "/usr/local/lib/python3.5/dist-packages/notebook/notebookapp.py", line 1120, in init_webapp
    self.http_server.listen(port, self.ip)
  File "/usr/local/lib/python3.5/dist-packages/tornado/tcpserver.py", line 142, in listen
    sockets = bind_sockets(port, address=address)
  File "/usr/local/lib/python3.5/dist-packages/tornado/netutil.py", line 197, in bind_sockets
    sock.bind(sockaddr)
OSError: [Errno 99] Cannot assign requested address

It seems that the port specification is not working properly ...

root@99a82fa3566a:~# jupyter notebook --ip=0.0.0.0 --allow-root
[I 05:22:36.074 NotebookApp] Serving notebooks from local directory: /root
[I 05:22:36.074 NotebookApp] 0 active kernels 
[I 05:22:36.074 NotebookApp] The Jupyter Notebook is running at: http://0.0.0.0:8888/?token=d49a54c4402d17c25448b86ecd04dd049d0069036125e3a3
[I 05:22:36.074 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 05:22:36.074 NotebookApp] No web browser found: could not locate runnable browser.
[C 05:22:36.075 NotebookApp] 
    
    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://0.0.0.0:8888/?token=d49a54c4402d17c25448b86ecd04dd049d0069036125e3a3

I specified ip as an option and did --allow-root and it worked for the time being (not recommended)

Now open your browser and you'll be able to use Jupiter! Yay!

end.

Recommended Posts

Building an auto-sklearn environment that semi-automates machine learning (Mac & Docker)
[Definitive Edition] Building an environment for learning "machine learning" using Python on Mac
Building an HPC learning environment using Docker Compose (C, Python, Fortran)
[Definitive Edition] Building an environment for learning "machine learning" using Python on Windows
Building an environment that uses Python in Eclipse
Building an environment for executing Python scripts (for mac)
Build a machine learning Python environment on Mac OS
I tried to build an environment for machine learning with Python (Mac OS X)
Rebuilding an environment for machine learning with Miniconda (Windows version)
Build an environment for machine learning using Python on MacOSX
An introduction to machine learning
Create an environment for "Deep Learning from scratch" with Docker
I made an API with Docker that returns the predicted value of the machine learning model
Machine learning environment construction macbook 2021
Build a machine learning environment
Machine learning environment settings based on Python 3 on Mac (coexistence with Python 2)
How about Anaconda for building a machine learning environment in Python?
Building a Windows 7 environment for getting started with machine learning with Python
Learn machine learning anytime, anywhere in an on-demand Jupyter Notebook environment
Building a Python environment on Mac
Error when building mac python environment
Django beginners tried building an environment
Building a machine learning environment with Tellus GPU server (Sakura high-power computing)
Django Crispy Tutorial (Environment Building on Mac)
Python & Machine Learning Study Memo: Environment Preparation
How to create an NVIDIA Docker environment
An introduction to OpenCV for machine learning
I created an Anaconda environment using Docker!
[Mac] Building a virtual environment for Python
[Python] When an amateur starts machine learning
Python and machine learning environment construction (macOS)
An introduction to Python for machine learning
Creating a development environment for machine learning
Build AI / machine learning environment with Python
Building an environment for "Tello_Video" on Windows