Example With Binary Logistic Regression

Let's assume we have a dataset containing information about whether individuals purchased a product (Yes or No) based on their age and salary. The goal is to predict whether a person will purchase the product based on these features.

Dataset

Age Salary Purchased
22 50000 No
25 60000 No
47 150000 Yes
52 200000 Yes
46 90000 Yes
56 160000 Yes
26 80000 No
27 58000 No
48 140000 Yes
50 135000 Yes

Function

In logistic regression, the probability p of the target variable (Purchased) being 1 (Yes) is modeled as:

$p = \frac{e^{(\beta_0 + \beta_1 \text{Age} + \beta_2 \text{Salary})}}{1 + e^{(\beta_0 + \beta_1 \text{Age} + \beta_2 \text{Salary})}}$

This is called a sigmoid function (not softmax) and you can read more about it here