I have these values of y and x:
y x
0 3
0 4
0 7
1 8
1 11
0 14
1 15
1 16
1 17
I want to calculate prediction for values 9 and 20 using logistic regression. But I don't understand how. I know that it can be calculated like this: $$P(y_{i} = 1) = P(y_{i} \geq 0) = P(\beta_{1} + \beta_{2}x_{i} + \varepsilon_{i} \geq 0) = P(\varepsilon_{i} \leq \beta_{1} + \beta_{2}x_{i}) = F(\beta_{1} + \beta_{2}x_{i}) = \frac{e^{\beta_{1} + \beta_{2}x_{i}}}{1+e^{\beta_{1} + \beta_{2}x_{i}}}$$ But I don't understand how coefficients $\beta_{1}$ and $\beta_{2}$ are calculated.
I calculated probabilities using python and sklearn library and it says that the probability for x=5 to be 0 is 0.82 and probability for x=20 to be 1 is 0.97
How it is calculated? Could you break down prediction for values 5 and 20 using my given dataset?