I'm trying to understand logistic regression, and I keep getting hung up on the following point. Let $Y$ be the dependent variable taking its values in ${0,1}$ with a single independent variable $X$ in the model, and let $p(x) = P(Y=1|X=x)$. According to my understanding, what we're really doing is fitting a linear model to the log odds. That is, we seek the maximum likelihood estimation of $\beta_0$ and $\beta_1$ where $$\log(p(x)/(1-p(x))) = \beta_0 + \beta_1 x.$$ I'm confused, however, at how the left hand side is actually computed when this fit is made. In particular, I don't understand how $p(x)$ is computed in the case that there is only a single observation at a particular X value.
By way of example, in the iris data set included in R, suppose I wanted to fit a logistic regression to determine whether the species is setosa (1), or not (0) with the independent variable Sepal.Length. How does one compute $p(4.3)$ for the (singular) observation where Sepal.Length=4.3?
I came up against this when I tried to actually plot the linear function on the right side against the (observed) log odds computed from the data, and realized I had no idea how to compute the left side. Thanks for any help!