K
K
karpo5182019-02-20 12:33:11
PHP
karpo518, 2019-02-20 12:33:11

How to select random items from db using mathematical probability based on each item's conversion?

I need 2 formulas:
1st will convert conversion rates to probability rates.
The 2nd one will determine the elements for issuance for each request based on the probability coefficients
. Who can tell? The task is solved for a site with the functionality of a directory on the PHP + MySQL stack. I put the details of the task under the spoiler.

spoiler
Пытаюсь повысить на сайте кликабельность элементов в блоке "Похожие товары/записи/элементы". Записываю связи между элементами и количество показов и кликов. Вывожу похожие элементы, отсортировав их по конверсии клики/показы. Дополнительно вывожу несколько позиций для дообучения блока.
В первую очередь для обучения подсовываются позиции, которые показали себя лучше без учета привязки к конкретным блокам, т.е. в целом высококонверсионные. Когда они набирают минимальное количество просмотров, то переходят в категорию обученных. Это означает, что при низкой конверсии они больше никогда не будут показаны.
Данный алгоритм имеет следующие недостатки:
1. Некоторые похожие элементы не успевают набирать минимальное количество просмотров, чтобы участвовать в выдаче. То есть система обучается слишком медленно, потому что связей много и достаточное количество показов всех связей невозможно набрать за адекватное время.
2. Позиции с высокой конверсией "железно закрепляются" в блоке. Если появится новая высоко-конверсионная связь, то обучение её может занять очень много времени.
Уменьшение минимального набора показов для обучения приводит к падению точности.
Я бы хотел изменить логику блока, которая замеряет конверсию новых связей. Элементы в этом блоке должны выводиться на основе математической вероятности появления. Тогда перспективные элементы будут "всплывать", а элементы с низкой конверсией будут исключаться из выдачи. Но все элементы, хоть и редко, но будут показываться в блоке.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Boris Korobkov, 2019-02-20
@BorisKorobkov

You checkers or go? If this is for a diploma, then one thing. And if to solve a specific problem, then another.
Let's say you have an online clothing store and you want to show "similar products". In this case, it is easier to store links not between hundreds of thousands of products, but between a dozen categories. For example, when buying any jacket, offer a hat, scarf and gloves.
For a dozen connections, learning will happen fairly quickly. While it's happening - use plain rand() to select a related category and pick the top selling item in that category.
To speed up, use "training with a teacher", that is, you yourself (or hire a freelancer) select related categories.
Then you can improve further. For example, if a jacket is from the average price range (among jackets), then a hat is also offered from the average price range (among hats).

V
Vladimir Goncharov, 2019-03-07
@morozovsk

SELECT * FROM elements ORDER BY conversion*RAND() DESC LIMIT 10

for example, elements have conversions like this:
0.1
0.3
0.2
0.5

Each will be multiplied by a random number. As a result, the probability of an element will depend on its conversion.
Those. in this example, the last element (0.5) will have the maximum probability, which, as a result of the query, will be in the first position.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question