In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to realize Logistic regression". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to achieve Logistic regression.
Logistic regression is used to model the probability of events by estimating the logarithmic probability of events. If we assume that there is a linear relationship between the logarithmic ratio and j independent variables, then we can model the probability p of the event as:
You may notice that the logarithm bottom is not specified. The base of the logarithm doesn't really matter. Recall that if we multiply both sides by logk b, we can change the base b to any new base k.
This gives us the flexibility to assume the base number on the left. Of course, the base number will affect the interpretation of the results and coefficient values.
Separation probability
If we have an estimation coefficient, it's easy to separate p. Note that p / (1 Meip) represents the probability of an event.
We will use another example to illustrate. Real estate agent Jim trained a logical regression model to predict the likelihood that someone would bid to buy a house. He keeps his model concise by using two explanatory variables:
X1: the number of times potential customers visit the house
The asking price of the house is several thousand dollars
After using the program to determine the optimal coefficients, Jim deduces these coefficients for his model:
Jim's model tells us:
For each additional visit of a potential buyer, the average probability naturally increases logarithm by 2.
For every $1000 increase in a house, the natural logarithm of the average probability decreases by 0.002.
It sounds like a mouthful, and it's hard to understand. We can explain it with a simpler technique.
We can simplify the explanation by calculating the values of e to the power of 2 and to the power of-0.002.
On average, for each additional visit, the probability of a potential buyer making an offer will increase by about 7.39 times.
For every $1000 increase in a house, the probability of an average bid is affected by 0.998 times.
If Jim's client, Sue, visits the house and the house is worth $1 million, we can use the formula derived above to estimate her probability of buying a house.
This suggests that Sue has about a 4 per cent chance of bidding for the house.
As a classifier
Although logistic regression is a regression model, it is often used for classification. The probability is always between 0 and 1. We can set an arbitrary threshold to predict the observed categories.
We can also extend logistic regression to more than two classifiers to make it a multi-class classifier. To this end, we can adopt a "one-to-one" approach, that is, train as many logical regression models as possible (each model predicts the logarithmic probability of a category) and adopt the category that produces the highest inference probability.
At this point, I believe you have a deeper understanding of "how to achieve Logistic regression". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.