Logistic regression and maximum entropy I have read (e.g. here) that a (multinomial) logistic regressor corresponds to a maximum entropy classifier.
My question is, how does one end up with the formula for logistic regression starting with the maximum entropy principle?
 A: TLDR; the logistic function can originate from an exponential function for different outcomes
$$p(y;x) \propto \text{exp}(f(y,x))$$
and with the normalisation using the sum $\sum_{\forall y} p(y;x)$ it becomes a logistic function
$$p(y;x) = \frac{\text{exp}(f(y,x))}{\text{other stuff}+\text{exp}(f(y,x))}$$
The connection with entropy is in the exponential function $p(y;x) \propto \text{exp}(f(y,x))$ which is similar to the Boltzmann distribution.

We want to estimate a probability distribution $$\hat{f}(y|x_1,x_2) = \begin{cases}p(y;x_1,x_2) &\quad \text{if $y=1$}\\
1-p(y;x_1,x_2) &\quad \text{if $y=0$}\end{cases}$$
where $y$ is a binary outcome variable and the $x_i$ are predictors.
Say we want to find a $\hat{f}$ that maximizes the entropy
$$H = E[-\log(\hat{f}(y,x_1,x_2)]$$
where $\hat{f}(y,x_1,x_2) = \hat{f}(y;x_1,x_2)f(x_1,x_2)$
with constraints
$$E[y \cdot x_1] = \frac{1}{N} \sum_{j=1}^N y_j x_{1j}\\
E[y \cdot x_2] = \frac{1}{N} \sum_{j=1}^N y_j x_{2j}$$
where the expectations are computed based on the empirical distribution/frequency of a sample $x_{1j}$ and $x_{2j}$ of size $N$.
Then the distribution will be of the form
$$ \hat{f}(y,x_1,x_2) = \frac{1}{Z} \text{exp}\left(\alpha_1 y \cdot x_1 + \alpha_2 y \cdot x_2\right) $$
where $Z$ is a normalisation constant.
The ratio of the conditional distribution will be
$$\frac{\hat{f}(1|x_1,x_2)}{\hat{f}(0|x_1,x_2)} = \frac{\hat{f}(1,x_1,x_2)}{\hat{f}(0,x_1,x_2)} = \frac{ \text{exp}\left(\alpha_1 1 \cdot x_1 + \alpha_2 1 \cdot x_2\right)}{\text{exp}\left(\alpha_1 0 \cdot x_1 + \alpha_2 0 \cdot x_2\right)} = \text{exp}\left(\alpha_1 \cdot x_1 + \alpha_2 \cdot x_2\right) $$
Then if you take the logarithm
$$\text{log} \left( \frac{\hat{f}(1|x_1,x_2)}{\hat{f}(0|x_1,x_2)} \right) = \text{log} \left( \frac{\hat{f}(1|x_1,x_2)}{1-\hat{f}(1,x_1,x_2)} \right) = \left(\alpha_1 \cdot x_1 + \alpha_2 \cdot x_2\right) $$
you get the logit function.
The parameters $\alpha_i$ will need to be found by optimizing the entropy (and this turns out to be the same as optimizing the likelihood).
