📜 ⬆️ ⬇️

We calculate content that will become viral in the future.

This article will describe only the general algorithm on the example of Facebook. However, the same approach can be used everywhere.

Task


Based on existing content (for the past 30 days) on this Facebook page, determine which entries will potentially be more popular.

Theory


The first, and perhaps the key question that I encountered is “What is the popularity of a post and how to calculate it?” .

Usually, by the popularity of recording in the social network mean the number of likes under it. But our case is not ordinary. If you simply rely on the number of likes, then we will not be able to determine a potentially popular post before it actually becomes one.
')
Sometimes use the ratio of likes / time of publication. Thus, it is possible to calculate the increase in likes per second. And where the increase is greater, then there will be our result. In part, this approach is correct, but only in part.

The fact is that the increase in likes is not linear. And the longer the post is published, the less it likes. And we need to take into account this decline in activity.

The formula for the calculation is as follows:

R = likes / (time^β)
Where β is our damping factor. It can be calculated by the formula:
β = 1 / τ
Where τ is the time during which the growth of likes has decreased by a factor of e .

Implementation


We will need:


The algorithm is as follows:


Using this approach, we can determine those records that are most likely to cause more interest in the future. In the calculations, we take into account both the date of publication of the recording and the activity of the audience, which allows us to obtain the most accurate results.

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


All Articles