📜 ⬆️ ⬇️

Machine learning for everyone who has studied eighth grade math

Hi, Habr! I present to you the translation of the article "Machine Learning for Anyone Who Took Math in Eighth Grade" by Kyle Gallatin.


Machine learning


I usually notice that artificial intelligence is explained in one of two ways: through the increasingly sensational prism of various media, or through dense scientific literature, riddled with redundant language and region-specific terms.


Between these extremes there is a less published area where, I think, literature should be a little more active. News about the “breakthroughs”, like this stupid robot Sophia , raise the HYIP around artificial intelligence and it may seem that this is somewhat similar to the human mind, while in reality Sophia is not smarter than AOL Instant Messenger.


Scientific literature can be even worse, forcing even the most sophisticated researcher to close his eyes after several paragraphs of meaningless pseudo-intellectual garbage. In order to properly evaluate AI , people must generally understand what it really is. And all you need to understand the basics of artificial intelligence is a bit of high school math.


I may be prone to oversimplification — and I will ask all my colleagues in mathematics, data science, and engineering to suffer my explanation — sometimes this is what you need in fancy science.


Basics of artificial intelligence and machine learning


Typical, classic artificial intelligence is all that imitates human intelligence. This can be anything from video game bots to complex platforms such as Deepmind Alphago .


Artificial Intelligence; machine learning; deep learning
Ignore the "deep learning" - in this context, it is the same as machine learning. Image: Geospatial World


Machine learning is a subset of artificial intelligence. This allows machines to "learn" from real data instead of acting on a set of predefined rules.


But what does “learning” mean? It may not be as futuristic as it seems.


My favorite explanation: machine learning is just y=mx+b on crack. If you’ve seen something like the Black Mirror , it’s pretty easy to start presenting modern artificial intelligence as a conscious being — what thinks, feels, and makes difficult decisions. This is even more common in the media, where AI is consistently personified and then compared to Skynet from the Terminator, or the movie The Matrix.


In fact, this is not the case. In its current state, artificial intelligence is just mathematics. Sometimes it is complicated mathematics, and sometimes it requires deep knowledge in the field of computer science, statistics and others. But in the end, modern AI is basically just a mathematical function.


Do not worry if you are not friends with mathematical functions, because you do not remember or use them. To capture the essence, we need to remember a few simple things: there is an entrance ( x ) and there is a way out ( y ), and the function is what happens between the input and the output - the connection between them.


We can make the computer look at the inbox ( x ) and going out ( y ) data and find out what binds them together.

An example of super-simplified artificial intelligence can be a function expressed as y=mx+b . We already know x and y (from the table below); we just need to find m and b to understand what is the connection between x and y .


x (entrance)y (output)
one2
23
3four
fourfive

Table: Kyle Gallatin


For this template to get y of x we need to multiply x on 1 ( m ) and add 1 ( b ). So will the function y=1x+1 .


Fine! We have determined that m=1 and b=1 . We simply took some data (from the table above) and created the function that described them. In essence, this is machine learning. Now, using the obtained function, we can make an assumption what will be equal to y for other input data x .


The interesting part is how you teach the machine to find which function best describes the data, but when you're done with this, what you do is usually some form. y=mx+b . As soon as we get this function, we can also plot it on the graph:
Linear equation
Screenshot from Tecmath video


For a more detailed explanation of the functions, Math Is Fun has an intuitive and simple site (even if the name is a potential red flag for you, and the site looks like their web designer escaped sometime in the early 2000s).


People fail to calculate, machines will manage


Obviously y=1x+1 - This is a very simple example. The only reason machine learning exists is that people cannot look at the millions of incoming and outgoing data points and come up with a complex function to describe the results. Instead, we can train the computer to do it for us.


In any case, there must be enough data to find the right function. If we only have one data point for x and y , neither we nor the machine could predict only one exact function. In the original example, where x=1 and y=2 function may be y=2x , y=x+1 , y=([x+1] cdot59)5+1 or many others. If we do not have enough data, the function that the machine will find can lead to a lot of errors when we try to use it for more data.


In addition, real data is not always so perfect. In the example below, the machine has defined several functions that correspond to most of the data, but the line does not pass through each point. Unlike the past example of a table from a mathematical class, data collected from the real world is more unpredictable and can never be completely described.


Regression analysis
This basic example shows how a machine learns to best describe the data presented. Image: Towards Data Science


Finally, the last thing people can't do is look at a bunch of variables. It's just using x and y , but what if there are more input variables? What if y affects x1 , x2 ... x100 . Very quickly, functions can become more complex (for people).


Machine learning and artificial intelligence in the real world


Let's look at a real example. I work in the pharmaceutical field, so suppose we have a cancer-related data set that has two incoming variables that correspond to the tumor size — the radius and the perimeter, and the output, with two possible values: is the tumor benign or metastatic (potentially dangerous)? for life). This may seem complicated, but we just need to apply a familiar concept. y=mx+b :



What does our linear equation look like now? Not much different from the example above:


diagnosis=(something1 cdotradius)+(something2 cdotperimeter)+unknown


As I explained above, we are going beyond the realm of human capabilities. So instead of looking at the data and trying to figure out what we should multiply our variables with, we use machines. They will do it for us, and we will get an accurate assessment of the diagnosis. And this is machine learning!


Of course, even the most detailed, multi-factor data is not perfect, so our machine learning model will not be the same either. But we do not need them to be correct in 100% of cases. We just need them to come up with the best possible function that fits most cases.




This part only scratches the surface of incredible mathematics and computer science, which is included in machine learning. But even at difficult levels the concept is the same. No matter how impressive or strange machine learning and artificial intelligence may seem, it all comes from the functions that the machine has learned to best describe the data.


')

Source: https://habr.com/ru/post/449558/


All Articles