Prepare for machine learning using Python

Source: Internet
Author: User

Prepare for machine learning using Python

The machine learning getting started book "Machine Learning Practice" uses the python language. The following describes how to use Python to prepare for machine learning. (Environment: CentOS 7)


1. Two important packages

NumPy and SciPy. (Http://scipy.org/scipylib/download.html) is mainly to deal with numerical operations, matrix operations and so on.

Note: Sci is short for Science.

The official website introduces the installation method, which can be manually installed or yum. (Numpy and scipy are provided in the default software source)

It should be noted that scipy depends on numpy. If you install it manually, install numpy first. If yum is used, the dependency is automatically processed.

Note: You can use yum info *** to check whether the software is provided in the software source. For example



2. 2D drawing: Matplotlib

This can also be obtained in yum,

sudo yum install python-matplotlib

If you use matplotlib in interactive mode, you 'd better use ipython. (although it can be executed in python shell)

Because plotting is a relatively high-consumption operation, python changes the graph only after all operations are completed. Ipython can achieve real-time changes. You can also use Baidu matplotlib and matlab.


3. for better interaction, use ipython

Ipython is not available in the default software source of centos 7. You can download the latest stable version of the source code on github and install it manually (decompress the package and run sudo python setup. py install ). Of course, if you have installed pip, you can install it directly:

sudo pip install ipython



The following is an example of plotting.

Terminal input ipython


Enter % pylab <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + pgltzybzcm9 "http://www.2cto.com/uploadfile/Collfiles/20141011/20141011084530390.png" alt = "\">


Input,

In [2]: x = randn(10000)In [3]: hist(x,100)
(Note: Is it similar to matlab ?)
Output,



This is the most basic software for "Machine Learning" using python. We will introduce it in detail later.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.