[Python Machine Learning] 01_Overview of Machine Learning

I. Introduction

In recent years, the term artificial intelligence has frequently appeared in our field of vision. From deep blue to AlphaGo, artificial intelligence has become the future trend. And machine learning is an important branch of artificial intelligence, so learning machine learning is also a good choice. This series of articles will use plain language to explain machine learning, and use the scikit-learn module to implement commonly used machine learning algorithms.

2. Machine Learning

Machine learning is the subject of extracting knowledge from data. It is a combination of computer technology and mathematical theories such as probability theory and statistics. Simply put, machine learning is about finding a function. We give an input and it can output what we want. We can look at a few practical examples.

Now face recognition, speech recognition, automatic driving and other technologies are relatively popular. We can look at the input, function and output of these three technologies respectively.

For face recognition, the input is an image of a face, and the output is the person's name or other identifiers, but we can't describe the function; for speech recognition, the input is a sound signal, and the output is text, and the function can't be described either; for automatic Driving, the input is the data of various sensors, the surrounding images, etc., the output is the next operation (turning the steering wheel, stepping on the accelerator, braking), the function we still can't describe.

For a face recognition system, the input is a picture of the face, and the output is the name of the person
It can be found that the functions that machine learning usually finds are very complex, and these functions are difficult to describe. It is precisely because people are difficult to describe that machine learning is required.

3. Supervised and Unsupervised Learning

3.1. Learning methods

We need a lot of historical data to drive the process of finding functions. Depending on the data, we usually have two different ways of learning. They are supervised learning and unsupervised learning.

For supervised learning, the data needs to contain two parts, the feature value and the target value. While for unsupervised learning, the existence of target value is not necessary. Below we use two examples to distinguish between supervised learning and unsupervised learning.

3.2. Supervised learning

If there is an archery task, our goal is to hit the bullseye. After many effective exercises, we can hit the bullseye very accurately. We can understand this task as supervised learning.

3.3. Unsupervised learning

Now there is another task. There are a bunch of iron balls weighing 10kg, 20kg, and 30kg. The same size iron balls are mixed together, so that you can throw them at random. Finally, we can see the effect of the following picture:

insert image description here

In the picture, green is 10kg, blue is 20kg, and yellow is 30kg. In order to distinguish

It can be found that green is concentrated in the outer circle, blue is concentrated in the middle, and yellow is the closest to the person. Although we cannot know the weight of the balls with the naked eye, we can guess the weight of the individual balls through the circle after the ball is dropped.

4. Machine Learning Algorithms

4.1, function set (function set)

We mentioned above that machine learning is about finding a function. But just saying that looking for a function is like looking for a needle in a haystack, there is no way to start. In order to have a clearer goal, we can further narrow the scope of the function. For example, we assume that the function we are looking for is of the form:
y = wx + by = wx + bY=wx+b
where x is the input, y is the output, and w and b are the parameters of our function. Because different w and b can determine different functions, we call the functions with unknown w and b on them as function sets.

After determining the function set, we can find an optimal function (the optimal set of w and b) in the function set. The specific search method will be explained later.

4.2. Algorithms

Machine learning algorithms play a very important role in machine learning. When we determine the algorithm to use, it is equivalent to determining the function set. After that, you only need to find the optimal function in the function set.

Each algorithm has its own advantages and is suitable for different tasks. Therefore, we can only use each algorithm well if we are familiar with the characteristics of each algorithm.

Here are a few algorithms we'll learn:

  1. k-nearest neighbors
  2. decision tree
  3. random forest
  4. Naive Bayes
  5. Linear regression
  6. logistic regression
  7. Support Vector Machines
  8. Neural Networks
  9. clustering

Not all are listed here, and will be introduced in detail later. Today's content is shared here. For more content, you can pay attention to "New Folder X".

Guess you like

Origin blog.csdn.net/ZackSock/article/details/122709496