Data Science: The Modern Alchemy of the 21st Century | November 16 2025, 04:02

A cryptic post today. While writing a book on RecSys, I caught myself thinking that modern data science is essentially the alchemy of the 21st century. Half of the “best practices” in algorithms lack a solid mathematical framework. It’s a set of heuristics that “just work”. Much like in the 17th century where they mixed everything indiscriminately, it happens now, and if something works better, everyone else starts doing the same. There’s just no answer to the question “why”.

Take, for example, the NCF/NeuMF (Neural Collaborative Filtering) algorithm. The logic goes like this. Say, there are a million movie ratings by users. And 100 million ratings by users yet given – users can’t watch every movie in the world. But out of these 100 million, you need to choose candidates for advertising for a particular user. The algorithm, of course, has a training phase, where weights are calculated, and a prediction stage, where these weights are used on the incoming data.

(What the algorithm does. Essentially, it’s an ensemble of three sub-algorithms, two of which generate their own conclusions, and then their decisions go to a new neural network, the third algorithm, which provides the final recommendation. Smartly, it’s a hybrid of GMF (matrix factorization) and MLP (Multi-Layer Perceptron). The first of these two is based on matrix decomposition, and the second represents a neural network with multiple layers. Weights are adjusted on training data.)

For one positive example, it takes 4 negative ones. Why four? Just because it’s “not too many and not too few”. Would 8 be better? Unknown, but it would definitely take longer to learn.

Why are embedding dimensions 32? or 64? There’s no formula. It’s the “golden mean” between a “dumb” model (few k) and an “overtrained” (many k).

Now about the neural network. Why is the MLP block built as a “tower” (64 -> 32 -> 16)? Why not (50 -> 25 -> 10)? Why ReLU between them (and not tanh for example)? Pure empiricism. The number of layers in the tower is also adjusted.

Why do GMF and MLP parts have different embeddings at the input? Because the authors of the paper tried it, and it “worked out better”. No mathematical proof. Why do they go to the final layer with equal weights? Because they just do.

Why are the outputs of the two paths “concatenated” (concat), and not added or multiplied? “Experience showed that this way the result is more accurate.”

And so it is with everything, up to the choice of optimizer Adam or the “magical” learning_rate=0.001, although at least these have some mathematical basis.

That is, at least a dozen parameters of one algorithm are empirically chosen, with no clear confidence that they are independent of each other. But many of them depend on the dataset, but no one knows how 😉

In general, alchemy.

Metchnikoff: Beyond Science and Survival | November 13 2025, 04:53

I was reading Metchnikoff’s biography (don’t ask why I ended up there) and thought about how much can fit into one life. He wasn’t just a scientist, but rather like a saga:

His elder brother Ivan was the prototype for Leo Tolstoy’s “The Death of Ivan Ilyich.” Another brother, Lev, was a prominent anarchist, sociologist and fought in Italy alongside Garibaldi. Metchnikoff himself tried to end his life twice: the first time after the death of his first wife (who, sick with tuberculosis, was carried to the church on a chair). He took morphine but survived. The second time was when his second wife Olga fell critically ill with typhus. He deliberately inoculated himself with relapsing fever. Fortunately, both survived. However, the Grim Reaper with his scythe only came after his third consecutive heart attack.

The dude graduated from university at 19 as an external student. I.M. Sechenov himself recommended him for a professorship. But Metchnikoff was “blackballed” (rejected) by one vote. In protest, Sechenov resigned along with him.

He founded the first bacteriological station in the country at that time in Odessa. But due to an employee mistake (they spoiled the anthrax vaccine) an entire flock of sheep died. After this scandal, he left Russia. The station — on Leo Tolstoy Street.

In Paris, he was immediately taken under the wing of Louis Pasteur (the father of pasteurized milk), who supported his theory and gave him a lab in his institute. There, Metchnikoff worked for 28 years, becoming the deputy director.

While studying cholera at the Pasteur Institute, Metchnikoff proposed a theory that not everyone who comes into contact with the pathogen gets sick. He suggested that it’s all about… (of course) the gut flora. To prove it, he deliberately drank a culture with cholera vibrios. Nothing happened (it would have surely happened to you, Metchnikoff thought)

In the end, he received the Nobel Prize for the discovery of phagocytosis (cellular immunity). He is also “the father of gerontology” — Metchnikoff was the one who proposed the theory that to achieve longevity, one must combat bad bacteria in the gut with probiotics. Now, they say, gerontologists around the world drink sour milk on May 15th remembering Metchnikoff.

He died in Paris, and his ashes are kept in the library of the Pasteur Institute.

Also, in the English Wikipedia he’s Élie Metchnikoff. Not easy to guess.

In the photo, Metchnikoff and Leo Tolstoy are discussing immunology.

Exploring Recommender Algorithms Through Interactive Visualizations and Sandbox Simulations | November 11 2025, 05:23

I’ve launched an electronic open source application for my book Recommender Algorithms! It’s a “sandbox” where you can “run” various recommendation algorithms with different settings, and view specific visualizations for each algorithm that help understand how it works. For instance, for algorithms like ItemKNN, SLIM, or EASE, a key visualization is a heatmap of the learned similarity matrix (item-item similarity matrix). This allows you to see which pairs of items the model considers “similar” (or “influencing” each other). For SLIM, for example, a useful “Sparsity Plot” shows that the similarity matrix indeed turned out to be sparse. For associative rule algorithms (Apriori, FP-Growth, Eclat) the visualization is not a graph, but interactive tables with found “Frequent Itemsets” and generated “Association Rules,” which can be filtered and sorted.

Additionally, there is a parametric mechanism for creating a “game dataset” — Dataset Wizard. It works like this – there are template datasets that describe items through characteristics. For example, recipes through flavors. Or movies through genres. The system generates random users with a random set of characteristics from the same set — and there are many sliders to make this distribution more contrasted or complex. Next, a matrix of user ratings of items is created – conditionally, if the characteristics of the user and the item match, then the rating will be higher because “tastes match”; conversely, if they differ, then the rating will be lower. Here too, sliders add noise and scarcity – randomly removing part of the matrix. The characteristics of products and users are not fed into the recommendation algorithm; they are hidden, but they are used to visualize the results.

The third component of the application is the tuning of hyperparameters. Essentially, it’s an auto-configurator for a specific dataset. An iterative approach is used, which is much more efficient than a full search (Grid Search) or random search (Random Search). In short, the system analyzes the history of past runs (trials) and builds a probability “map” (surrogate model) of which parameters will likely yield the best result. Then, it uses this map to smartly choose the next combination to test. This method is called Sequential Model-Based Optimization (SMBO).

The code is open source and will be further supplemented with new algorithms and new visualizations.

Link to the code in the comments.

Link to the site where the code is deployed and where you can check out the application is also in the comments.

Unveiling “Recommender Algorithms”: A Comprehensive Guide on Recommendation Systems | October 25 2025, 17:36

I finally released a book on #RecSys! It’s called Recommender Algorithms, where I’ve compiled over 50 recommendation algorithms with detailed mathematical derivations, thorough explanations, and code examples.

https://www.testmysearch.com/books/recommender-algorithms.html

It all started early this spring in Germany, when I attended an ACM conference and sketched out the first structure of the book while analyzing the talks from the RecSys track. And now, just six months later, it has come to life.

Why did I write it? Because neither online nor in print is there a single, accessible resource that deeply explores recommendation algorithms of various types and purposes. There are articles focused on small subsets, but collecting and systematizing approaches—from foundational methods to the very latest—seems to have never been done before. I don’t know if I succeeded, but I’d love to hear your feedback.

Please like & share!

P.S. Click at READ SAMPLE to see the first 40 pages. The table of contents is there as well.

https://www.testmysearch.com/books/recommender-algorithms.html

https://www.testmysearch.com/books/recommender-algorithms.html

Unraveling the True Meaning of “Admission to the Bar” | October 14 2025, 01:20

It turns out that the phrase “barristers must gain admission to the bar” is not at all about bars and baristas, as I would have thought, had I not read that it’s actually about lawyers in the US. Admission to the bar” — is the official admission to legal practice (for barristers). And a Barrister” is a lawyer who represents clients in court. There’s also Solicitor” — a lawyer who works with clients and documents.

Historically, bar” literally means a bar (barrier) in court, separating the area where the judges and lawyers sit from the rest of the hall. Being called to the bar” means being called to the barrier,” i.e., being admitted to represent cases in court. Today, the bar” refers to the legal profession as a whole or the legal community.

Actually, it all started when I saw the title (professional designation) “Esq.” with a guy’s name and realized I didn’t understand any of these letters often listed after names. There are a lot of them, and you’ve probably seen PhD, M.D., or CPA numerous times.

From Vision to Bookshelf: Launching “Recommender Algorithms” | October 13 2025, 11:54

Finally, I have released a book! It is called Recommender Algorithms — it contains more than 50 recommendation algorithms with mathematical explanations, detailed descriptions, and code examples.

It all started early in the spring in Germany, when I attended the ACM conference and made the first sketches of the book’s structure, analyzing reports on the RecSys stream. And now, six months later, the book has been published.

Why did it appear? Because there is no single, accessible source either online or in print where the recommendation algorithms of various types and purposes are thoroughly examined. There are articles focused on narrow aspects, but to collect and systematize the developments — from fundamental to the most recent — until now, it seems, no one has managed to do it for some reason. Maybe no one needed to. Suddenly, I found I needed to. I don’t know if I succeeded, but I am eager for your feedback.

Available on Amazon and Barnes and Noble. There is a Russian automatic translation (surprisingly, but very decent), but I do not know how to sell it yet.

https://www.testmysearch.com/books/recommender-algorithms.html?FB

(This is not my only book, but today — just about this one.)

Decoding Solr and Lucene: Engineering Insights and Algorithms | October 06 2025, 17:11

Preparing a book for publication on Solr&Lucene. What do you think about publishing such a translation on Amazon? 🙂

The book is about algorithms and under-the-hood engineering. I haven’t seen books from this angle yet, maybe someone will find it interesting.

Exploring the Chaos Game: Creating Fractals From Randomness | October 04 2025, 15:32

I read something interesting today. About fractals. If you take any three points that form a triangle, and then a fourth point anywhere, and subsequently throw a dice, the faces of which are assigned to the first three points. Next, you move from the current point towards the point corresponding to the result on the dice and place a new point halfway; this becomes the new current point. After many iterations, the points start to form the Sierpinski triangle – the one shown in the attached picture. Intuitively, you would think the triangle should be fully filled because it involves random movements in three directions from a randomly chosen point, but no. Moreover, it works even if the starting point is inside the future empty triangle (yes, a few points will disrupt the picture, but that’s it). If you start our experiment with five or six points instead of three, different shapes will form – see the attached picture. This graphical method is called the Chaos Game.

By the way, it may seem obvious, but in case you wondered — all the presented figures have zero area.

If you take two triangles and with a probability p move towards random vertices of the first, and with (1-p) towards random vertices of the second, you end up forming a Barnsley fern (picture №2).

I love such things because they seem like magic at first glance 🙂

(It’s a kind of problem from the same class as the synchronization of metronomes)

Celebrating Marcia Klioze at the Arts Club of Washington | October 03 2025, 22:42

Friends, I am currently at the opening of Marcia Klioze’s exhibit at the Arts Club Of Washington and I am absolutely thrilled! I am so happy for my wonderful mentor, from whom I have been learning oil painting for two and a half years. Today her solo exhibition is here, and the atmosphere is simply magical.

I am proud to be learning from her invaluable experience and learning to see the world anew. Next Tuesday is another class😉 I’ve wanted to post her works for a long time, and today I finally have the opportunity to share (I asked for permission, so it’s all official)!

Almost all works are for sale, for those who are interested, do drop by

Understanding Jerusalem Syndrome and Its Global Counterparts | October 01 2025, 16:10

Listening to Sapolsky in the background, he mentioned Jerusalem Syndrome. It’s when a deeply religious American Baptist from the southern USA, having saved money and prepared, arrives in the Holy Land and sees that Jerusalem is just another city: traffic jams, smog, noise, pickpockets, McDonald’s—everything like that. And then—an interesting feature—in all cases, the person tears up sheets, takes off their clothes, and suddenly finds themselves on the streets of Jerusalem, dressed as if in a toga, begins to preach on the streets, calling for a simpler life and all that.

A psychiatric team arrives, takes the person to the hospital for a few days, everything becomes clear, they send him back home, and he never encounters this syndrome again.

Each year in Jerusalem, about up to many dozens of cases are recorded. It’s a recognized syndrome, about which scientific articles are published.

Sapolsky says that if hotels in Jerusalem always had, for example, checkered sheets instead of white ones, which seem to “invite” one to don a toga, it would help prevent the crisis.

But amusingly, there’s a twin brother of this disorder, the Paris Syndrome, which for some reason mainly affects the Japanese. Japanese tourists come to Paris because they are attracted by the culture, language, literature, and history of France, as well as the landmarks of Paris. However, once there, they encounter difficulties such as a language barrier (surprise surprise!), differences in mentality, and disappointment from the reality of Paris not meeting their expectations.

There’s also a milder version called the “Florentine Syndrome.” This often happens during a visit to one of the 50 museums in Florence, the cradle of the Renaissance. Suddenly, a visitor is overwhelmed by the depth of feeling the artist has imbued in the artwork. At this point, they acutely perceive all emotions, as if transported into the space of the image. Victims’ reactions vary up to hysteria or attempts to destroy the painting. Despite the syndrome’s relative rarity, guards in Florentine museums are specially trained on how to deal with its victims.

Overall, be careful with syndromes when you’re traveling.

PS. This image was made for me by google. In the second image, a guy in a tie tells a tearful girl 脆培, which seems just a meaningless set of characters, something like fragile culture. But when I asked ChatGPT, it told me it resembles 脱げ (nugu) — undress 🙂 if you ask Google Gemini to redo it, Google gives the same picture, where he’s also shouting 暁は, but at the same time, he has already taken off his shirt. But that’s also unclear what 暁 – it’s dawn. Generally, with Japanese, LLM is bad. I’ll leave the second image in the comments. By the way, there are several differences there, you can play a game to find ten differences. They are amusing