当前位置:网站首页>Finally, someone explained the supervised learning clearly
Finally, someone explained the supervised learning clearly
2022-07-02 13:04:00 【Big data V】
Reading guide : Among various methods of machine learning , Supervised learning is by far the most impressive achievement . This article introduces the basic principles of supervised learning in solving problems such as pneumonia diagnosis .
author : Paul · Perota (Paolo Perrotta)
source : big data DT(ID:hzdashuju)
01 What is supervised learning
We should carry out supervised learning , We need to start with a set of sample data , Each sample has a label that the computer can learn . for example :
As you can see , Samples can be many different things : data 、 Text 、 voice 、 Video etc. . Besides , The label can be The number , It can also be type . The value tag is just a value , Like temperature – Lemonade converter . The type tag represents a category in a predefined collection , For example, in the example of dog breed detector .
Use some imagination , You can think of many other examples to predict things , Predict other things based on values or type tags .
We assume that some labeled samples have been collected . There are now two stages of supervised learning :
Stage 1: Training phase
We provide labeled samples to an algorithm for discovering patterns . for example , The algorithm may notice , All the scanning images of pneumonia have some common features ( It may be some opaque areas ), These features are not found in the non pneumonia scan . This stage is called the training stage , Because the algorithm will look at the sample data again and again , And learn to recognize these patterns .
Stage 2: Prediction stage
Now the algorithm knows what pneumonia looks like , Then switch to the prediction stage . We can harvest the results of training work at this stage . Show the trained Algorithm Not marked Of X Light scanning pictures , The algorithm will tell us whether it has the characteristics of pneumonia .
Here is another example of supervised learning —— A system that can recognize animal types . Each input data is a picture of an animal , The label of each sample is the species of animals in the picture . In the training phase , We show the algorithm the tagged image . In the prediction phase , We show the algorithm an unlabeled image , The algorithm is required to guess the label of the image .
I've said that before , Computer programs can be used in the process of machine learning “ Work out ” data . Supervised learning is an example of this process . In the traditional programming process , You can write a program to let the computer calculate the output from the input ; In supervised learning , Just give the sample data of program input and output , The computer can learn how to calculate an output from an input by itself .
Now that you have read a farsighted explanation of supervised learning , Then there may be more problems than when you first learned . We said , The supervised learning procedure is in the sample data “ Pay attention to common features ”, and “ Discovery patterns ”— But how did it do it ? Let's start at an abstract level , See how this magic is realized .
02 The mathematical principle behind magic
Supervise the use of learning system Function fitting This mathematical concept is used to understand the relationship between sample data and its labels . Next, we will introduce the basic principle of this mathematical concept with specific examples .
Imagine , There is a solar panel on your roof . You are like a supervised learning system , Learn how solar panels generate energy , And predict the amount of energy generated in a certain period of time in the future .
It takes time to predict the energy output of solar panels 、 Weather and other variables . Time should be an important variable , So you decide to focus on the variable of time . For the real supervised learning process , You should start by collecting sample data on the amount of energy produced by solar panels at different times of the day . After several weeks of random sampling , You get the following data list :
Each row in the above table contains The input variable ( Time ) And labels ( Energy value generated ) Sample data for , Just like the system that recognizes animals , Animal pictures are input , Animal names are labels .
If you draw these sample data into a chart , Then we can visually see the relationship between time and solar panel capacity :
We know at a glance , Solar panels do not generate energy at night , And the energy value reached its peak at noon . As shown in the figure below , Although the supervised learning system is not as smart as the human brain , But it can approximate the sample data into a function , So as to realize the understanding of data .
It is not easy to find a fitting function that is close to the sample data . however , The subsequent prediction stage is much simpler . The system will forget all the sample information , And use the found fitting function to predict the energy generated by the solar panel at some time in the future , For example, the energy generated at noon is shown in the following figure :
This is what I call supervised learning, which realizes the algorithm function through function fitting . The actual sample data received by the supervised learning system is usually chaotic and incomplete . In the data training stage , We usually need to construct a relatively simple function to approximate the complex actual data . In the prediction phase , Then the constructed fitting function is used to predict the unknown data .
As a programmer , You are used to thinking about many situations that may go wrong . therefore , You may already be considering ways to complicate the processing of sample data . for example , The energy output of solar panels is not only related to time , It will also be affected by other factors , For example, the influence of clouds or months .
If you collect data on all these variables , Then we will get a multidimensional point cloud , It will not be possible to visualize these point cloud data using a simple chart . Again , For solar panels , What we need to predict is the value tag . You may want to know how to convert this kind of numeric label into non numeric label ( Such as the name of animals ), That's the category label .
You only need to know a little now : No matter how many complex things you superimpose on it , The basic idea of supervised learning is the same as what we just described —— Find a pile of sample data , Find a function that can approximate these sample data .
Modern supervised learning systems are very good at this kind of fitting . in fact , This fitting function can be powerful enough to fit extremely complex functional relationships —— for example X The relationship between light scanning pictures and diagnosis conclusion . Of course , The function used to fit these corresponding relationships will be very complex for us humans . However , For computer systems, it's a piece of cake .
This article is excerpted from 《 Machine learning programming : From coding to deep learning 》, Issued under the authority of the publisher .(ISBN:978-7-111-68091-8)
《 Machine learning programming : From coding to deep learning 》
Click on the picture above to learn and buy
Please contact wechat for reprint :DoctorData
Recommended language : Language humor , Examples are vivid , Suitable for zero basic readers to learn machine learning . Suitable for intelligent science and Technology 、 Data science and big data technology 、 Introduction to machine learning for undergraduate or graduate students of computer science and technology and related majors , It can also be used as a reference for engineers and self-study readers .
Focus on
Dry goods go straight to
Choice of microservice governance framework : contrast Spring Cloud and Istio
Heavy inventory !2021 The most popular technical dry goods of the year , It's all here
More exciting
Enter the following dialog box in the official account dialog box key word
See more quality content !
read | book | dried food | Make it clear | God operation | handy
big data | Cloud computing | database | Python | Reptiles | visualization
AI | Artificial intelligence | machine learning | Deep learning | NLP
5G | Zhongtai | User portrait | mathematics | Algorithm | Number twin
According to statistics ,99% The big coffee is concerned about the official account
边栏推荐
- Linear DP acwing 902 Shortest editing distance
- Rust search server, rust quick service finding tutorial
- ArrayList与LinkedList效率的对比
- spfa AcWing 851. spfa求最短路
- 百款拿来就能用的网页特效,不来看看吗?
- Variable, "+" sign, data type
- [opencv learning] [common image convolution kernel]
- JS10day(api 阶段性完结,正则表达式简介,自定义属性,过滤敏感词案例,注册模块验证案例)
- About the loading of layer web spring layer components, the position of the layer is centered
- bellman-ford AcWing 853. Shortest path with side limit
猜你喜欢
JDBC prevent SQL injection problems and solutions [preparedstatement]
传感器 ADXL335BCPZ-RL7 3轴 加速度计 符合 RoHS/WEEE
模数转换器(ADC) ADE7913ARIZ 专为三相电能计量应用而设计
自主可控三维云CAD:CrownCAD赋能企业创新设计
Sensor adxl335bcpz-rl7 3-axis accelerometer complies with rohs/weee
堆 AcWing 838. 堆排序
js1day(输入输出语法,数据类型,数据类型转换,var和let区别)
JS10day(api 阶段性完结,正则表达式简介,自定义属性,过滤敏感词案例,注册模块验证案例)
js5day(事件监听,函数赋值给变量,回调函数,环境对象this,全选反选案例,tab栏案例)
Async/await asynchronous function
随机推荐
Rust search server, rust quick service finding tutorial
三面阿里,有惊无险成功拿到offer定级P7,只能说是真的难
Jerry's weather code table [chapter]
Async/await asynchronous function
Browser storage scheme
基于STM32的OLED 屏幕驱动
VLAN experiment
ArrayList与LinkedList效率的对比
Js6day (search, add and delete DOM nodes. Instantiation time, timestamp, timestamp cases, redrawing and reflow)
[opencv learning] [moving object detection]
Jerry's watch modifies the alarm clock [chapter]
Linear DP acwing 902 Shortest editing distance
Interview questions for software testing - a collection of interview questions for large factories in 2022
8 examples of using date commands
Rust language document Lite (Part 1) - cargo, output, basic syntax, data type, ownership, structure, enumeration and pattern matching
染色法判定二分图 AcWing 860. 染色法判定二分图
Do you know all the interface test interview questions?
js5day(事件监听,函数赋值给变量,回调函数,环境对象this,全选反选案例,tab栏案例)
bellman-ford AcWing 853. Shortest path with side limit
线性DP AcWing 895. 最长上升子序列