Many friends want to learn machine learning, but suffer from the construction of the environment, here is the Windows Scikit-learn Research and development environment to build steps.
Step 1. Installation of Python
Python has versions of 2.x and 3.x, but many good machine learning Python libraries do not support 3.x, so it is recommended to install version 2.7 of Python. Currently the latest Python is 2.7.12. Links are as follows:
https://www.python.org/downloads/release/python-2712/
You can see the 32-bit version and the 64-bit version. If your machine is a 64-bit version, then either the 32-bit or the 64-bit version of the installation is optional. If the machine is a 32-bit version, you can only install the 32-bit version. If you can't figure out the number of bits in your machine, then install the 32-bit version. That is, "Windows x86 MSI Installer".
Windows x86-64 MSI Installer |
Windows |
For amd64/em64t/x64, not Itanium processors |
8fa13925db87638aa472a3e794ca4ee3 |
19820544 |
Sig |
Windows x86 MSI Installer |
Windows |
|
fe0ef5b8fd02722f32f7284324934f9d |
18907136 |
Sig |
After installation, you can set the environment variables, add Python directory to path, such as my python loaded in C:\Python27, then I add C:\Python27\Scripts and C:\Python27 to the environment variable. Of course, not to add. This adds Python's full path name each time you use Python.
After the installation is complete, enter Python on the command line of Windows, if you can come up with Python's basic information stating that the installation was successful.
Step 2. Installation of the Python Package management tool PIP
We need the package management tool to facilitate the installation of the Python library, there are many package management tools, I am accustomed to the use of the PIP.
Download the PIP installation script. The links are as follows. Download get-pip.py. Then go to your download directory and enter "Python get-pip.py" on the command line to finish the installation.
https://pip.pypa.io/en/stable/installing/
After downloading, remember to run this command "Pip install-u Pip", one is to see if PIP can work properly, and the second is to upgrade the PIP to the latest version.
Step 3. InstallationVisual C + + Compiler for Python
Links in this: https://www.microsoft.com/en-us/download/details.aspx?id=44266
This does not fit behind a lot of scientific calculations will not fit.
Step 4. Installing NumPy and SciPy
These two buddies are essential tools for scientific computing and matrix operations.
Because NumPy and scipy directly with PIP installation often have a variety of problems, it is generally recommended to download the offline version of the WHL to install NumPy and scipy.
First install the offline version of the NumPy, here I generally download the link below NumPy, of course scipy is also in this.
http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
You can see that there are many versions of numpy available to download, our Python is 2.7,windows 32-bit, so download "NUMPY-1.11.2+MKL-CP27-CP27M-WIN32.WHL"
After downloading, go to the download directory and run "Pip install NUMPY-1.11.2+MKL-CP27-CP27M-WIN32.WHL" on the command line so that the NumPy is installed successfully.
Install the scipy in the same way. Download scipy on the link below.
http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
Our Python is 2.7,windows 32-bit, so choose SCIPY-0.18.1-CP27-CP27M-WIN32.WHL Download.
Run "Pip Install SCIPY-0.18.1-CP27-CP27M-WIN32.WHL"
So NumPy and scipy two good base friends will be done.
Step 4. Installing Matplotlib,pandas and Scikit-learn
There's nothing to say, just run the following command at the command line. Note that installing matplotlib before installing pandas
Pip Install-u matplotlib
Pip Install-u jinja2
Pip Install-u Jsonschema
Pip Install-u pyzmq
Pip install-u pandas
Pip Install -U scikit-Learn
Step 5: Install Ipython and Ipython notebook
Ipython Notebook is the most commonly used Python interactive learning tool, of course, now called Jupyter Notebook. The Scikit-learn official example gives a version that runs with Ipython notebook.
The installation method is simple:
Pip Install Ipython
Pip Install Jupyter
Official website in this: http://ipython.org/notebook.html
After installation, enter "jupyter notebook" or "Jupyter-notebook" at the command line, and the output will prompt you notebook to run thehttp://localhost:8888
Step 6. Hello world! Try running a scikit-learn machine learning program
Download a machine Learning example on Scikit-learn's website, such as: HTTP://SCIKIT-LEARN.ORG/STABLE/_DOWNLOADS/PLOT_CV_PREDICT.IPYNB
Then run "jupyter Notebook" in the download directory, then the browser opens http://localhost:8888
.
You can see the contents of your download directory in the browser, we open the newly downloaded plot_cv_ PREDICT.IPYNB This file link, you can see the contents of the Python program, then we can point to the above triangle button, step by step running the program, if there is no error, we can finally see a linear regression prediction diagram.
This program can be modified to run a step further, to achieve the purpose of research and learning.
The above is the construction process of scikit-learn and pandas environment. Hope that we can build success, to study machine learning.
(Welcome reprint, reproduced please indicate the source.) Welcome to communicate: [email protected])
Scikit-learn and pandas based on the Windows stand-alone machine learning environment