LRÂ is one of the most widely used classifiers to predict a binary response. It is a linear ML method, as described in Chapter 1, Analyzing Insurance Severity Claim. The loss function is the formulation given by the logistic loss:
![](https://static.packt-cdn.com/products/9781788479042/graphics/assets/58d1cdb4-4e46-48ce-8051-bf44e2fbf31c.png)
For the LR model, the loss function is the logistic loss. For a binary classification problem, the algorithm outputs a binary LR model such that, for a given new data point, denoted by x, the model makes predictions by applying the logistic function:
![](https://static.packt-cdn.com/products/9781788479042/graphics/assets/a34028da-b03e-4cb1-a247-c08dd7e7d7ce.png)
In the preceding equation, z = WTX and if f(WTX)>0.5, the outcome is positive; otherwise, it is negative.
Note that compared to linear regression, logistic regression provides you with a higher classification accuracy. Moreover, it is a flexible way to regularize a model for custom adjustment...