No, of course, I'm not serious. There must be a limit to how far one can simplify a subject. However, for the initial stages, understanding basic concepts and quickly getting into the topic, it might be acceptable. As for how to title this material (options: "Machine Learning for Dummies," "Data Analysis from Scratch," "Algorithms for the Littlest Ones"), we will discuss that at the end.
To the point. I've written several practical programs in MS Excel for visualizing and clearly presenting the processes that occur in various machine learning methods during data analysis. Seeing is believing, after all, as the saying goes in the culture that developed most of these methods (by the way, not all of them. The powerful "support vector machine" method, or SVM, was invented by our compatriot Vladimir Vapnik, from the Moscow Institute of Management. 1963, by the way! He now teaches and works in the USA).
Three files for review
1. K-means clustering
These tasks fall under "unsupervised learning," where we need to divide the initial data into a predetermined number of categories, but we have no quantity of "correct answers"; we must extract them from the data itself. The fundamental classical problem of finding subspecies of iris flowers (Ronald Fisher, 1936!) is precisely of such nature.
The method is quite simple. We have a set of objects represented as vectors (sets of N numbers). For irises, this consists of sets of 4 numbers that characterize the flower: the length and width of the outer and inner tepals, respectively (). The distance, or measure of proximity between objects, is the usual Euclidean metric.
Next, cluster centers are chosen arbitrarily (or not arbitrarily, see below), and distances from each object to the cluster centers are calculated. At this step of the iteration, each object is marked as belonging to the nearest center. Then the center of each cluster is moved to the arithmetic mean of its members' coordinates (akin to physics, it is also referred to as the "center of mass"), and the procedure is repeated.
The process converges quite quickly. In the 2D visualizations, it looks like this:
1. Initial random distribution of points on the plane and number of clusters

2. Defining the centers of the clusters and assigning points to their respective clusters

3. Moving the coordinates of the cluster centers and recalculating point membership until the centers stabilize. The trajectory of the cluster center's movement to its final position is visible.

At any moment, new cluster centers can be set (without generating a new point distribution!) and you can see that the partitioning process is not always unambiguous. Mathematically, this means that for the optimized function (the sum of squares of distances from points to the centers of their clusters), we find a local minimum rather than a global one. This problem can be overcome by either non-randomly selecting the initial cluster centers or by iterating through possible centers (sometimes it is beneficial to place them exactly at one of the points, guaranteeing that we do not get empty clusters). In any case, a finite set always has a precise lower bound.
(don’t forget to enable macro support. The files have been checked for viruses)
Description of the method on Wikipedia —
2. Polynomial approximation and data partitioning. Overfitting
The remarkable scientist and popularizer of data science K.V. Vorontsov succinctly describes machine learning methods as 'the science of drawing curves through points.' In this example, we will find patterns in the data using the least squares method.
The technique of partitioning the original data into 'training' and 'test' sets is shown, as well as the phenomenon of overfitting, or 'fine-tuning' to the data. With proper approximation, we will have a certain error on the training data and a somewhat larger one on the test data. With improper approximation, there will be an exact fit to the training data and a huge error on the test data.
(It is a well-known fact that through N points, a unique N-1 degree curve can be drawn, and this method does not generally yield the desired result. )
1. We set the initial distribution

2. We divide the points into 'training' and 'test' sets in a 70 to 30 ratio.

3. We draw an approximating curve based on the training points and see the error it produces on the test data.

4. We draw an exact curve through the training points and observe a huge error on the test data (and zero on the training data, but what good is that?).

The simplest case is shown with a single split into 'training' and 'test' subsets; in general, this is done repeatedly for optimal coefficient tuning.
Enable macros for proper operation.
3. Gradient descent and the dynamics of error changes.
Here we will have a 4-dimensional case and linear regression. The coefficients of linear regression will be determined stepwise using the gradient descent method, initially all coefficients will be zeros. A separate graph shows the dynamics of error reduction as the coefficients are tuned more accurately. There is an option to view all four 2-dimensional projections.
If the step of gradient descent is set too large, we will consistently skip the minimum and take more steps to reach the result, although eventually we will arrive (unless we set the step too high, in which case the algorithm will 'run wild'). The graph of the error dependency on the iteration step will not be smooth but 'jerky'.
1. Generating data, setting the step for gradient descent.

2. With the correct choice of the gradient descent step, we smoothly and quickly reach the minimum.

3. With an incorrect choice of the gradient descent step, we skip the maximum, the error graph is 'jerky', and convergence takes more steps.

and

4. With a completely incorrect choice of the gradient descent step, we move away from the minimum.

(To reproduce the process with the values shown in the pictures for the step of gradient descent, check the 'reference data' option.)
Does the respected community consider this simplification and the method of presenting the material acceptable? Is it worth translating the article into English?
Source: habr.com
