Download the installer for your environment from the URL below and install it. https://www.virtualbox.org
Also download the "Oracle VM VirtualBox Extension Pack" and run it after installing VirtualBox to install it.
Download the virtual hard disk image from the following URL and extract the Zip file. https://www.ubuntulinux.jp/download/ja-remix-vhd
Start VirtualBox and create a new virtual machine with "New (N)". * See the above URL.
When the virtual machine name is set, the following folders are created in the home directory, so save the virtual hard disk image in the target folder.
[Example] When the virtual machine name is "Ubuntu"
Windows
[Home directory]¥VirtualBox VMs¥Ubuntu¥
Mac/Linux
~/VirtualBox VMs/Ubuntu/
By the way, I set the main memory to 4GB.
After setting, start the virtual machine and perform the initial settings.
If you want to operate the virtual machine with SSH connection instead of directly operating it, follow the steps below.
After the initial settings are completed and the desktop is displayed, execute the following command so that you can connect to the virtual machine by SSH.
$ sudo apt-get install openssh-server
After execution, shut down the virtual machine and change the VirtualBox network setting from "NAT" to "Bridge Adapter". This allows an SSH connection to the virtual machine's IP address.
$ ssh [username]@[IP address]
Please refer to the following site. http://qiita.com/akito1986/items/be5dcd1a502aaf22010b
Install the packages required to install pyenv.
$ sudo apt-get install git gcc make openssl libssl-dev libbz2-dev libreadline-dev libsqlite3-dev
Execute the following command.
$ cd /usr/local/
$ sudo git clone git://github.com/yyuu/pyenv.git ./pyenv
$ sudo mkdir -p ./pyenv/versions ./pyenv/shims
$ cd /usr/local/pyenv/plugins/
$ sudo git clone git://github.com/yyuu/pyenv-virtualenv.git
Create a PATH configuration file.
$ echo 'export PYENV_ROOT="/usr/local/pyenv"' | sudo tee -a /etc/profile.d/pyenv.sh
$ echo 'export PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"' | sudo tee -a /etc/profile.d/pyenv.sh
$ source /etc/profile.d/pyenv.sh
Operation check.
$ pyenv --version
PATH setting for sudo
$ sudo visudo
Edit as follows.
#Change
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
↓
# Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
#add to
Defaults env_keep += "PATH"
Defaults env_keep += "PYENV_ROOT"
Execute the following command
$ sudo pyenv install -v 3.5.1
Confirmation after installation.
$ pyenv versions
* system (set by /usr/local/pyenv/version)
3.5.1
Change the default version.
$ sudo pyenv global 3.5.1
Confirmation of change result.
$ pyenv versions
system
* 3.5.1 (set by /usr/local/pyenv/version)
$ python --version
Python 3.5.1
In addition, 3.5.1 is the latest version as of April 12, 2016.
Please refer to the following site. http://qiita.com/icoxfog417/items/950b8af9100b64c0d8f9
Execute the following command.
$ sudo pyenv install miniconda3-3.19.0
$ sudo pyenv global miniconda3-3.19.0
Check the execution result.
$ pyenv versions
system
3.5.1 (set by /usr/local/pyenv/version)
* miniconda3-3.19.0 (set by /usr/local/pyenv/version)
$ python --version
Python 3.5.1 :: Continuum Analytics, Inc.
Execute the following command.
$ conda create -n ml_env numpy scipy scikit-learn matplotlib cython ipython python-notebook
$ source ./.conda/envs/ml_env/bin/activate ml_env
(ml_env)$
See the tutorial on the official website. http://scikit-learn.org/stable/tutorial/basic/tutorial.html
Load and display the sample dataset.
$ python
>>> from sklearn import datasets
>>> iris = datasets.load_iris()
>>> digits = datasets.load_digits()
>>> print(digits.data)
[[ 0. 0. 5. ..., 0. 0. 0.]
[ 0. 0. 0. ..., 10. 0. 0.]
[ 0. 0. 0. ..., 16. 9. 0.]
...,
[ 0. 0. 1. ..., 6. 0. 0.]
[ 0. 0. 2. ..., 12. 0. 0.]
[ 0. 0. 10. ..., 12. 1. 0.]]
If it is output as above, OK!
The problem is what to do from now on ... (sweat)
Recommended Posts