In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is about how to understand the LR model, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
Why LR?
People already know what LR is, but there is one more question that has not been answered. That's why LR models were so popular in the early years. Can't you use other models that look more advanced, such as decision trees, random forests, GBDT? Isn't it said that XGBoost works very well in all kinds of competitions? Why doesn't the industry make recommendations?
This confusion is even more obvious when I read GBDT+LR 's paper launched by Facebook in 2014.
This paper is very classic, has a very important position in the industry, and can even be said to be one of the paper that must be read in the recommended field. Before the rise of deep learning, many companies and manufacturers have followed this practice, the practice in this paper is not difficult, it is an innovative approach, in fact, the essence is to take the node to which the sample falls in GBDT prediction as multi-hot coding, and then regard the array of 01 after this coding as a new feature, and then use this transformed feature to train LR. It can be said that its essence is still training LR, the so-called GBDT is just an encoder.
When I read this paper article at that time, I already understood the meaning of it, but there was one problem that I couldn't figure out. Now that GBDT is used, isn't it delicious to combine with other models? must it be combined with LR?
I estimate that many practitioners in the field of recommendation may not be able to answer this question. I'll make a note of it first, write down the question here, and answer it later.
What are the characteristics of the recommended field?
In the field of algorithms, it is difficult to peel off the effect, feature and model. A good model also needs good feature support, and a good feature needs a good model to fully express. So let's put aside the problem of the model and think about the features.
There are only three main features in the field of recommendation. Take e-commerce as an example, they are item,user and context. That is, goods, users and environmental information, such as time, place, display location and so on. Context features are relatively few, so there are only a few back and forth, so let's put them aside for a while. The rest are users and commodities, and the characteristics we form around users and commodities can be divided into two parts, one is the basic features, and the other is the statistical features.
Take commodities as an example, the basic features are brand, price, category, evaluation, and statistical features are recent click-through rate, recent sales, recent conversion rate, and so on. According to the category, these characteristics can be divided into two types, one is the floating-point continuous feature, the other is the category feature, such as the category of goods, brands and so on. It's normal to be here, and there's nothing hard to understand or incredible.
Let's move on and take a look at the target that the model wants to predict-the click-through rate. If we combine the predicted goals of the model and look at the characteristics listed above, you will find that except for a few indicators such as historical click-through rate and historical conversion rate, which are strongly positively correlated with the final result, other floating-point features have no particularly significant positive or negative correlation. Can it be said that the price of goods is negatively related to the click-through rate? In fact, it is not very good, the cheaper the goods are, the worse the quality may be, but no one will order them. What about the purchasing power of users? The richer you are, the more goods you have? It's not true.
For this reason mentioned above, there are few floating-point features that work well in the field of recommendation, and most of them are category features, that is, 01 features.
So do you think GBDT, random forest and XGboost models will work well? It's hard to say, because the strengths of these models often lie in floating-point features, that is, continuous features. These tree models will design rules to segment these continuous features. If most of the features are 01 features, how can they be segmented?
So, at this point, the answer is why, before the rise of deep learning models, LR was widely used in recommended areas instead of tree models that looked good.
The principle of LR Model
LR model is a pure linear model, which can be simply understood as the weighted sum of several features. The weight of each feature is large or small, and finally add up to get a prediction probability. There is nothing wrong with this, and everyone who has studied it knows it.
But as we move on to the next level, have you ever wondered what this means in the field of recommendation?
It means that the model actually "remembers" the relationship between each feature and the final result, and we personify the model and think of it as a robot. The robot saw that the sample had feature An and clicked, so the weight of feature An increased a little, and the sample had feature B but did not click, so the weight of feature B was reduced. The model is to find the best balance in such a strategy.
This means that some features that are easy to remember tend to work better. For example, men usually buy cigarettes and women usually buy lipstick, so we can design a combination of men's cigarettes and women's lipstick. When the model sees that most men click on the cigarette, it can learn that the combination is a strong feature and gives a higher weight. In this way, as long as we find out the combination of these features as much as possible, then the model can get good results.
So at this point, you will understand that the LR model plays a role in the field of recommendation, essentially relying on "memory". Because it can remember those category features and the combination of category features, it tends to work better than tree models that look more high-end. This is why in the late LR era, the work of algorithm engineers is to mine some combinations of category features all day in order to expect the model to achieve good results.
Advantages and disadvantages of LR model
At this point, we are almost done with the application of the LR model in the field of recommendation. Let's make a simple summary, starting with its advantages.
The advantages of LR model have been mentioned in the textbook, for example, the training speed is fast, because the parameter space is relatively small, the LR model can converge quickly, and its training speed is much faster than those tree models and later deep learning models. The second is the strong interpretability, because we can check the weight of all the features, so it is easy to explain what features play a role, or what features are holding us back.
But LR also has a big disadvantage in the field of recommendation, what is it, that is, a lot of dirty work.
Because almost all feature combinations need to be excavated manually, we need to traverse many feature combinations manually, or even try to find the best combination one by one. This process requires a lot of manpower, which can almost be said to be pure labor. So for algorithm engineers in the LR era, the feeling of screws may be much more serious than it is now, there is basically no need to think about the optimization model, and there is no room for optimization for a simple model like LR, so basically all you have to do is to do experiments with features.
The above is how to understand the LR model, the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.