Logistic regression is a method for classification: the problem to indentify to which label or category some new prediction belongs to, such as email in spam, good lenders, etc.

The most popular model is the binary clasification, which means the prediction is YES/NO. This is modelized with the Sigmoid Function (SF) as a probability. The SFis the key to LR: convert a continuous number into 0 or 1.

– LR is a method for classification: What labels are assigned to certain prediction.
– Binary classification: convention is to have 2 classes: 0 and 1
– The result is usually a probability, so we can assign 0 or 1 if <0.5, or >0.5

After training the model with LT the way to evaluate it is with the Confussion Matrix.


from sklearn.linear_model import LogisticRegression
logmodel = LogisticRegression()

predictions = logmodel.predict(X_test)