logo academy

What is machine learning: how artificial intelligence learns

March 16, 2023

10 min

What is machine learning: how artificial intelligence learns

Technological devices in the age of the Internet of Things are intelligent because they can learn from experience, just like humans: let’s find out what machine learning is and formulate a definition, looking at examples of algorithm types in artificial intelligence.

What is machine learning? Definition and meaning

The meaning of machine learning (ML) is very current, although it sounds like a futuristic fantasy. Concrete examples will help us understand what it is, distinguishing the main types of algorithms and the tasks they can perform.

First of all, this technology is an application of artificial intelligence (AI) and consists of creating computer systems capable of ‘learning‘ from the data provided, but without the need for specific programming; the aim is to automatically identify patterns and rules from the information, in order to categorise it, make predictions and make decisions. The definition of machine learning, in practice, could be ‘an algorithm that allows computers to simulate human learning processes, progressively improving the accuracy of the tasks performed’.

Let’s take a technical and historical step back to better understand what machine learning is. In computer science to solve a problem, according to mathematician Lotfi Zadeh, there are essentially two ways: 

  • Hard computing – a method based on deterministic (true or false) or binary (1 or 0) logic and computational accuracy. It requires precise mathematical models and algorithms programmed down to the last detail. Hard computing mechanisms are ‘fixed‘ and immutable, i.e. they can be applied without modification to problems of the same type.
  • Soft computing – a method based on calculating probabilities that admits approximation and imprecision. This process is useful for dealing with complex problems involving ‘partial truths’ and is inspired by human reasoning, which tolerates incomplete information. Rationality, in this case, derives from past experience, which serves as a blueprint for assessing an uncertain environment. In the light of new findings, however, the previous model is supplemented and corrected

Alan Turing, on the subject of soft computing, hypothesised the creation of a ‘learning machine‘, later realised in genetic algorithms: in practice, programmes that seek the optimal solution to a problem by combining existing ones with new ones, in a process of continuous improvement. Arthur Samuel, in 1959, then coined the term machine learning, applying it to the game of draughts, programmed into a computer. A few years later, champion Robert Nealey lost a game to a ‘trained’ IBM 7094, leaving mankind in disbelief. 

In a nutshell, then, to explain what machine learning is, we can think of a context in which it is not possible to use ‘classical’ algorithms, because we do not have precise instructions and are therefore forced to proceed on a case-by-case basis, creating and optimising models on the basis of the data collected. This is machine learning, which Tom Mitchell gives us a practical definition of in his book Machine Learning: 

“A programme is said to learn from experience E with reference to some class of task T and with performance measurement P, if its performance in task T, as measured by P, improves with experience E.”

What are machine learning algorithms?

The meaning and purpose of machine learning is to generalise information gathered from experience in order to recognise rules and patterns. This type of reasoning is called inductive (or Aristotelian) and consists precisely in establishing a universal law from individual cases. In practice, thanks to machine learning, computers are able to solve new problems on the basis of those already observed. 

The training phase, in particular, defines what machine learning is in four types of algorithms:

  1. Supervised: the programme is provided with a ‘labelled’ database, consisting of inputs matched to the desired outputs, in order to guide it in determining the general rule that binds them;   
  2. Unsupervised: the information given is not distinguished in any way and the algorithm has to search for a structure, pattern or model that predicts its next occurrences;
  3. Semi-supervised: the data assigned to the programme is an incomplete subset of a larger set, because the inputs are limited and some without output. Likewise, however, the algorithm will have to find a law to justify them;
  4. By reinforcement: the computer does not analyse a database, but interacts with a dynamic environment or an ‘adversary’, from which it will receive positive feedback in the event of an exact result. Given the massive intervention of a ‘supervisor’, this type of machine learning is similar to the former, but in this case it is by trial and error. 

We can learn more about what machine learning is and its types by also considering the output required:

  • Classification: the algorithm must assign new inputs to one of the classes (outputs) indicated by the programmer, based on already indicated matches. This supervised (or reinforcement) task, for example, could be useful for filtering emails in order to recognise spam;
  • Linear regression: the programme’s machine learning must lead, from the data, to a function linking a dependent variable to one or more independent variables. Basically, a law that clarifies what relationship exists between the factors highlighted by the programmer, in order to predict future results. Automated trading mechanisms, which analyse past trends to trade the market, could be an example of machine learning by linear regression;
  • Logistic regression: the LM must estimate the probability of the occurrence of an event based on its past chances, the result of a combination of several variables. A logistic regression algorithm could estimate, as a percentage, a football team’s chances of winning, taking into account several factors from previous matches, such as the number of chances created or goals conceded. In general, regression tasks are supervised because they are based on the analysis of categorised information; 
  • Clustering: an unsupervised machine learning algorithm that has to divide the provided data into groups, but without knowing the classes a priori. In contrast to classification, in fact, the programme must also create categories on the basis of the distinguishing properties of the information, so as to group the data according to ‘similarity’. Data mining could be an example of machine learning for clustering, i.e. a technique used by companies to perform exploratory analysis on its customers in order to discover unknown characteristics.

How a computer learns: deep learning and neural networks

The concept of machine learning is often used as a synonym for artificial intelligence, but having defined what machine learning is, it is evident that the latter is rather a property of AI. ChatGPT, for instance, learns from user interaction, sometimes correcting itself to produce more accurate answers. However, we might wonder how such software learns: to explain this, we can rely on the artificial neural network model, a type of machine learning algorithm that can be traced back to the ‘reinforcement’ type.

Essentially, a neural network ML system consists of at least 3 layers, in communication with each other: input, hidden and output, although we may have multiple ‘hidden’ layers; each layer is composed of several nodes, connected to at least one of the next ‘layer’. The functioning is similar to our brain, the nodes are the neurons and the connecting channels are the dendrites and axons through which information is exchanged. Moreover, each connection has a weight and an activation threshold: in a nutshell, specific information attracts others more easily, such as a smile attracts the concept of happiness.

The process of machine learning by reinforcement, therefore, is divided into three phases:

  1. Decision process: based on the input provided, the required output is produced, be it a model, classification or prediction.
  2. Error function: the accuracy of conclusions is assessed, based on comparison with expected results or known examples.
  3. Model optimisation: if errors are found in the output, what is technically called backpropagation takes place. In practice, connection weights are corrected so that the next time a certain input no longer gives the wrong output.

Machine learning, in this case, is a recursive process: it is repeated several times until optimal results are achieved. Every machine learning algorithm, however, needs revisions in some way: learning from one’s mistakes is the basis of learning, in the same way computers are tested several times, providing different inputs, before reaching the best answer.

The example of the artificial neural network, in addition to explaining what machine learning is, allows us to clarify the difference with deep learning: ‘depth’ corresponds to the number of ‘hidden’ layers, which allow for more sophisticated analyses of raw, unstructured data. In fact, deep learning is generally an unsupervised form of machine learning, also called scalable machine learning.

Examples and problems of machine learning

The applications of machine learning are many and some can be found in our daily lives. The voice recognition and speech transcription features found in smartphones are examples of machine learning, as are the algorithms that recommend movies on Netflix or content on Instagram based on our preferences. Similarly, ML is used at the corporate level to recognise fraud or for customer service. Finally, machine learning is fundamental for autonomous driving and even for classifying celestial objects!

The immense usefulness, however, is accompanied by certain problems, first and foremost ethical ones: if a machine learning system is trained with biased and prejudiced data, it could give rise not only to false, but classist and racist conclusions. In that case, who would be responsible for such errors? The company would certainly be at fault, not only if the algorithm was supervised, because it did not check the accuracy of the input data. Another question is the impact machine learning will have on some jobs: could it replace humans? No algorithm is able to predict this, but to date no Artificial Super Intelligence (ASI) has yet been developed, but we only have narrow examples that cannot currently surpass the skills of a skilled and trained individual.