[PYTHON] Build a machine learning environment

Introduction

I wanted to build an environment for machine learning, but it seems that installing a special library that is used for machine learning as it is may cause the computer to start up strangely and the OS to start up. So, this time, I will introduce a method for building an OS-independent virtual environment to prevent such a situation. This time, we will introduce from the contents of Introduction to Machine Learning for Data Analysis.

Operating environment

The operating environment this time is

It is like this.

Building a virtual environment

First, use pip and enter the following command to install virtualenv.

$ sudo pip install --upgrade virtualenv

After installation, we will actually build a virtual environment with virtualenv. Enter the following command.

$ virtualenv --system-site-packages sample

This will create a directory called "sample". We will build a python execution environment here. If you no longer need it, you can easily uninstall it by deleting the entire directory. Let's take a look at how to specifically activate this virtual environment.

$ cd sample
$ . ./bin/activate

After activating, the terminal display will change as follows.

(sample)$ 

The virtual environment is now running. To restore it, use the deactive command.

(sample)$ deactivate  

Installation of scikit-learn

Now install the machine learning library scikit-learn in this virtual environment. After activating the virtual environment you built earlier, enter the following command.

(sample)$ pip install -U scikit-learn

You have now installed scikit-learn. From now on, we will create a machine learning program using this scikit-learn.

Recommended Posts

Build a machine learning environment
Build a Python machine learning environment with a container
Build a machine learning Python environment on Mac OS
Build a machine learning application development environment with Python
Build a machine learning environment natively on Windows 10 (x64)
Build a python machine learning study environment on macOS sierra
Build a machine learning environment on mac (pyenv, deeplearning, opencv)
Creating a development environment for machine learning
Build a PyData environment for a machine learning study session (January 2017)
Build AI / machine learning environment with Python
Machine learning environment construction macbook 2021
Build a Python environment offline
Build an interactive environment for machine learning in Python
Machine learning
Memo for building a machine learning environment using Python
Create a machine learning environment from scratch with Winsows 10
Build a go environment using Docker
Inversely analyze a machine learning model
Build a python3 environment on CentOS7
Build an environment for machine learning using Python on MacOSX
(Now) Build a GPU Deep Learning environment with GeForce GTX 960
Launching a machine learning environment using Google Compute Engine (GCE)
Build a machine learning environment using PyCharm on Ubuntu environment (TensorFlow will also be introduced!)
You don't need to install Anaconda to build a machine learning environment. Let's use Miniconda
Python & Machine Learning Study Memo: Environment Preparation
Easily build a development environment with Laragon
How to build a sphinx translation environment
How about Anaconda for building a machine learning environment in Python?
Build a python environment on MacOS (Catallina)
Build a Tensorflow environment with Raspberry Pi [2020]
A story about machine learning with Kyasuket
I want to build a Python environment
Python and machine learning environment construction (macOS)
[Linux] Build a jenkins environment with Docker
[Memo] Machine learning
Machine learning classification
Build a python virtual environment with pyenv
Build a Python + OpenCV environment on Cloud9
Build a capture acquisition machine with Selenium
Build a modern Python environment with Neovim
Machine Learning sample
[Linux] Build a Docker environment with Amazon Linux 2
Quickly build a python environment for deep learning and data science (Windows)
Build a "Deep learning from scratch" learning environment on Cloud9 (jupyter miniconda python3)
Building a machine learning environment with Tellus GPU server (Sakura high-power computing)
Build a LAMP environment on your local Docker
Machine learning memo of a fledgling engineer Part 1
Build a LAMP environment in a very short time
A story about simple machine learning using TensorFlow
Build a WardPress environment on AWS with pulumi
Simply build a Python 3 execution environment on Windows
Build a Django environment on Raspberry Pi (MySQL)
Build a Python environment on Mac (Mountain Lion)
Create a python3 build environment with Sublime Text3
Build a Django environment with Vagrant in 5 minutes
Build a Python development environment on your Mac
[Memo] Build a virtual environment with Pyenv + anaconda
Build a simple Python virtual environment without pyenv
Build a virtual environment with pyenv and venv
Build a Django development environment with Doker Toolbox
Build a Kubernetes environment for development on Ubuntu