- Practical Predictive Analytics
- Ralph Winters
- 222字
- 2025-04-04 19:02:43
Logistic regression
Logistic regression is one of the oldest and stable techniques that one can use for classification. Logistic regression, linear regression, and Poisson regression are all considered General Linear Models (GLM). However, in the case of logistic regression, the predicted value can only be 0, or 1. Fortunately, this corresponds with many use cases, such as whether or not a customer will leave, or whether or not a hurricane will appear. If you are already familiar with multiple linear regressions, logistic regression should be easier to understand, since you should already be familiar with concepts such as specifying multiple independent variables, and the use of mathematical functions, such as log and exp, which can smooth the variables in the model and force it to be more linear.
Logistic regression is also useful, in that it produces an odd ratio. An odd ratio is the probability that an event will occur divided by the probability that the event will not occur.
A standard logistic regression is called in R via the glm() function.
The simplest general form of the glm() function is:
Model.logistic <- glm(Target~v1+v2+v3,data=sourcedata,family=binomial())