Welcome to “Algorithms and the Beauty of Programming” ↑ pay attention to us!
This article was first published on the wechat official account “Beauty of Algorithms and Programming”. Welcome to follow and learn more about this series of blogs in time.
Artificial intelligence (AI) has become extremely popular in recent years, and there is a huge talent shortage in China. As a result, the salaries of recent graduates in this major are also ridiculously high.
Faced with such a high salary, many people are eager to devote themselves to learning artificial intelligence, and machine learning is the foundation of artificial intelligence. Therefore, it is necessary to first understand what machine learning is and learn the relevant algorithms of machine learning.
The introduction
Before introducing the concepts of machine learning, let’s take a look at a few simple examples.
First of all, let’s look at a primary school math fill-in-the-blank question, the topic is as follows:
Please fill in the blanks with the correct figures.
2 4 () 8 10
This topic should only be at the level of primary school mathematics, I believe that all students must have no pressure, we will quickly get the answer is: 6.
So why is the answer 6?
Let’s rewrite the above form as follows:
x 1 2 3 4 5
y 2 4 ? 8 to 10
Where x is the current number, so the first number is 2, the second number is 4, and so on, and all we need to figure out is what the third number is. By observing the table above, we can see that there is a mapping between y and x, that is, y = f(x) = 2·x. With this mapping, we can quickly calculate the number in the third position. By substituting x=3 into the function, we can get y = f(3) = 2· 3 = 6.
Through the case introduction above, we can come to the conclusion that when we know the mapping relationship between independent variable X and dependent variable Y, we can quickly predict the value of dependent variable Y corresponding to other independent variable x. So the mapping relationship is very important, and if we can’t get this relationship quickly through observation, then it’s going to be very troublesome to do.
But a lot of times, we don’t know exactly what the mapping is just by looking at it, right?
Now let’s look at another slightly more complicated case.
This is a figure between house prices and square footage, where X is square feet and y is price. If you were asked to fill in the price of 500 square feet, you might hesitate. This question is not as easy to calculate as the one above, because we don’t know what the mapping is.
If we want to compute the result, the premise is to know the mapping relationship, but we don’t know what the mapping relationship is, so we have to rely on the machine to learn what the function is, and when we have the function, we can compute the result.
There are thousands of functions in the world, so what is the function? The purpose of the machine is to learn from these thousands of functions that correspond to the function in question. It’s going to be a long process, but once the machine learns this kind of function, it’s going to be incredibly powerful, and if you give an independent variable, you get the value of the dependent variable.
Now let’s look at a text case.
When we read some news websites at ordinary times, we often read the news we are interested in according to the classification of the news.
Suppose we’re going to ask the computer to categorize the news, give you a story, and the computer tells me what category the story is in?
[history] “Qingming River map 3.0” : once into the picture a day dream back to a thousand years
[History] Why did Xu Shiyou indulge in hunting every day before the war against Vietnam in 1978
Just 20 days after China’s “ultimatum”, India quickly backtracked and complied
[Military] Us military to buy Russian supersonic anti-ship missile research how to counter China and Russia
[military] Navy 052B destroyer docking caused lenovo to change the large 054A?
Based on the above information, I’ll ask you to fill in the blanks
Chiang Ching-kuo gave Zhang Xue-liang what he kept taking for 50 years and lived to be over 100 years old.
This kind of fill-in-the-blank question should be relatively easy for a human to do, but how to get a machine to do it?
If the machine were to do it, it would have to know the mapping between headlines and news categories:
F (‘ Headline ‘) = Category of news.
Once the mapping is in place, all we need to do is simply plug into the function and get the result:
F (‘ What did Chiang Ching-kuo send to Zhang Xue-liang? Zhang persisted in taking it for 50 years and lived to be over 100 years old ‘) = ‘history’
F (‘ What is the biggest threat to the PLA in 1996 ‘) = ‘military’
Finally, let’s look at an example of a picture.
We want computers to classify animals, such as:
This is a cat.
At this point, the computer needs to learn the mapping relationship of such pictures, namely:
F (picture) = Animal category
Once you have this mapping, you can give the machine any picture, and it can calculate according to this relationship, such as:
f() = the dog
f() = cat
The difference between traditional algorithms and machine learning algorithms
The traditional algorithm is that we humans directly tell the computer what rules should be followed and what mapping function should be calculated according to, but unfortunately, most of the time we humans do not know what the mapping relationship is. The beauty of machine learning is that we don’t know what the mapping is beforehand, so we need to let the machine learn the mapping itself, and once it has this mapping, it can make calculations and predictions.
conclusion
From the above introduction, you should understand what machine learning is, what is the difference between machine learning and traditional algorithms, and the charm of machine learning. In our real world, it is impossible for human beings to understand all the rules of nature, and it is impossible to know all the functional mapping relations. Therefore, we need computers to help us better understand the world, discover the rules of the world, and discover the mapping relations of the world. Therefore, the core of machine learning is to learn all kinds of mappings in nature, that is, to learn all kinds of functions. This is the heart of machine learning.
So how does the machine find the right function from the thousands of functions? How to predict the future, welcome to continue to pay attention.