Supervised Machine Learning

Most of the examples we've seen so far are actually examples of supervised machine learning . Supervised machine learning involves algorithms that fit perfectly with what we've been talking about so far and help us learn how to map one set of values to another. Therefore, it is necessary that in the data set to which they are applied, in addition to the values of the attribute, we also know the values of the target variable.

 The two main tasks of supervised machine learning are regression and classification . In both regression and classification tasks, we want to learn to predict values, but in regression tasks, values can be arbitrary, and in the case of classification, they can be from a predefined finite set of values. Thus, regression tasks are suitable for predicting the value of temperature, the price of a product (the task of determining the price of real estate that we encountered in the introductory part is an example of a regression task), the devastation of an earthquake, and the like. On the other hand, determining whether mail is undesirable or desirable or determining the genre of a film are classifying tasks because the set of values we have on the other side is finite - mail can be either desirable or undesirable (two values) while a genre can be, say, comedy, drama, action, or thriller (four values). A little later, we will introduce a more precise definition of each of these tasks.

im1

Classification and regression. Determining whether someone is tall or short is the task of classification. Determining the exact height is the task of regression.

Unsupervised Machine Learning

We use unsupervised machine learning in tasks that need to examine the structure of a data set. For example, if we analyze the purchases of consumers of one store, it can be interesting to notice products that are often bought together in order to distribute them more finely in the store, improve the offer, but also profits. In the same way, user comments can be analyzed and grouped and the services or features that users are talking about can be insighted. Tasks of this type, in which we want to see groups among the data, are called clustering. Later in the course, you will learn about the k-mean algorithm, the most well-known clustering algorithm.

im2

Clustering

Spotting instances of data that are somehow different from others also falls under the tasks of unsupervised machine learning. Thus, spotting atypical measurements of a factory's sensors can be a signal to initiate additional security procedures. Similarly, spotting atypical banking transactions, for example, from a remote location or in some unusual amount, can be hints of fraud. This task of unsupervised machine learning is called anomaly detection.

im3

Anomaly detection

Unsupervised machine learning also deals with the tasks of reducing dimensionality . Often, for the purposes of graphical representation of data, we need to move from a larger number of attributes to a smaller number of attributes, for example, two or three. It is clear that during this transformation, some information from the initial data set is lost, but, on the other hand, the ability to display data and perhaps a better insight into some regularities is gained. Smaller dimensionality of data (fewer attributes) is desirable and because of the faster execution of algorithms and less memory complexity, which can be especially important if we have limited resources to work with. Some of the most commonly used algorithms for dimensionality reduction are principal component analysis. principal component analysis (PCA) and t-SNE.

im4

The Meaning of Dimensionality Reduction: Two Cuboids and Their Projections from Three-Dimensional to Two-Dimensional Space

Interestingly, in unsupervised machine learning tasks, it is not necessary to know the values of the target variable. Clustering, anomaly detection, and dimensionality reduction are performed only on the basis of attribute values.

Reinforcement learning

Surely you have seen many times how to train a dog. When he is given a task, for example, to bring a ball from the other end of the yard, the reward in the form of a cookie when he brings it will motivate the dog to perform this task even more successfully and joyfully next time. This idea also lies at the basis of learning by reinforcement. Reinforcement learning is an area of machine learning used in tasks such as playing games or driving autonomously. It is characterized by the existence of an environment that has its own states, an agent that can perform a certain set of actions and the concept of reward. The goal is for the agent in a given environment, whose states are changing, to choose (learn) the sequence of actions that allows him the greatest reward. In the context of the introductory example, the yard is the environment. Its states can be a ball at the end of the yard or a neighbor's cat in a tree. A dog is an agent, and the set of actions it can take is to run, to sit, to go to sleep. The reward can be a number of cookies or nothing. If the dog chooses the right sequence of actions (run, find it and return it) to a change of environment, for example, the appearance of a ball, he will be able to win the biggest prize.

im5

You will learn more about this type of learning at the end of the course.

New directions of learning

When we need to master a new task, for example, to learn to ride a scooter, we don't start from scratch. All the knowledge and skills we have acquired in some other tasks, for example, playing basketball, cycling, and even perseverance and patience in tasks that were not our favorite, such as tidying up the basement, help us to master it better. This idea is the basis of transfer learning. That's why you can often hear people talking about models that have been used as the basis for the development of some other model. Such models are first trained on some general data sets and tasks, and then retrained, i.e. They can also be used to solve a very specific task. For example, the GPT language model was used as a basis for the development of the ChatGPT model, which had previously performed well in the tasks of generating summaries, shortened versions of text, and answering questions.

im6

The idea of learning through the transfer of knowledge

Knowledge transfer techniques can be combined with all the above-mentioned types of learning. They are especially important to us when the training datasets for a specific task are not large enough or when we are developing a model for a specific domain.

 

Last modified: Friday, 4 April 2025, 8:30 AM