One article tell you why Python is the preferred language of Machine Learning

Introduction 
to developers in the field of machine learning is, Python is one of the most popular programming languages. Neither is the fastest Python language (can easily be substituted with C + and C), not necessarily the most easy to learn language (R Matlab, and can have a smaller learning curve). So why python ranked 57% of data scientists and machine learning developers first one is PYPL index as one of the most popular programming language? As a programmer, I think it comes down to two things: a large library of programming simplicity and Python provides. 
 
Very simple. Hearted. Convenience.

Python allows developers in a short time from one idea to another product. While writing code for a similar process may require the development of language (such as c +) developers spend hours or even days of time to plan, complete and write, but python developers can write code for the same (minutes). For example in the following examples, it explores the use of c + read a simple CSV file, I is the output from this solution c + temporarily written into the matrix

#include <iterator>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
class CSVRow
{
    public:
        std::string const& operator[](std::size_t index) const
        {
            return m_data[index];
        }
        std::size_t size() const
        {
            return m_data.size();
        }
        void readNextRow(std::istream& str)
        {
            std::string         line;
            std::getline(str, line);
            std::stringstream   lineStream(line);
            std::string         cell;
            m_data.clear();
            while(std::getline(lineStream, cell, ','))
            {
                m_data.push_back(cell);
            }
            if (!lineStream && cell.empty())
            {
                m_data.push_back("");
            }
        }
    private:
        std::vector<std::string>    m_data;
};
std::istream& operator>>(std::istream& str, CSVRow& data)
{
    data.readNextRow(str);
    return str;
}   
int main()
{
    std::ifstream       file("test.csv");
    std::vector< CSVRow > mat;
    CSVRow   row;
    while(file >> row)
        mat.push_back(row);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
It works should be, but the code is very large. Even if we ignore that this is a 49-line solution, it is very difficult to read and understand. Now let's look at the same code for my python version.

CSV Import
MAT = csv.reader (Open ( 'test.csv', 'R & lt'), DELIMITER = ',')
. 1
2
so 2 rows. Only one line of code and the actual command to import a CSV constructed object. Most importantly, it is easy to read and understand, and therefore can easily be passed to another developer.

library!

Python is an easy to read, understand and code language, very good, but the simplicity of the language where it combined with machine learning? The library is the key here. We want to create an n-dimensional matrix to achieve matrix algebra in your program? Use Numpy. I want to perform advanced mathematical functions to analyze your Numpy array? Use Sipi. Want to see the graphic visualization of your data? Matplotlib is the answer. Perhaps you want to combine Scipy and Numpy to create a basic machine learning models; enter Scikit- learning. Want something more specific you? Perhaps NLTK natural language processing library OpenCV library or image analysis is more appropriate. Perhaps you want to go beyond the use of machine learning and deep learning? Like library TensorFlow, Xi Yanuo, and pitot Welch can do heavy work, such as Kala Si and class can make you easier to code. The key is to have a lot of resources allows you to quickly create models and machine learning applications. 
 
Closing thoughts

Double leadership principles that we hold in Anant bias for action and deliverables for developers and business leaders, it is important to make decisions and prioritize tasks, rather than spending a lot of time to find the "perfect" solution. It is important to understand the only programming language that should be used in machine learning python is not, nor is it the ideal language. In the long run, you may need to use a language other than python to perfect your machine learning process. However, python is unique because it allows you to quickly create a functional prototype machine learning models, namely collaborator is a huge developer community.

to sum up

There are a lot of hype and interest in today's machine-learning environment, most people have heard of machine learning never really tried to machine learning, because they think they do not have their own ideas into real technical skills or knowledge. Python is a bridge between the concepts and products. With simple language, high-level library, the most important is the developer community, any skill level programmers can create their own machine learning applications.
Product is slightly Library http://www.pinlue.com/

Guess you like

Origin blog.csdn.net/yihuliunian/article/details/91351474