Solution (source code)

= Solution

For word-count vector $x$, the fitted <logistic model> is
$$
\log\frac{\widehat p(x)}{1-\widehat p(x)}
=-5.391451+1.859318x_{\rm dollar}
+5.680691x_{\rm winner}+0.923072x_{\rm password}
-6.890095x_{\rm edu}+2.269523x_{\rm credit}
$$
$$
{}+1.198028x_{\rm discount}-3.176676x_{\rm as}
-1.866328x_{\rm I}+4.347929x_{\rm fun}
+0.864456x_{\rm trial}.
$$
Holding other counts fixed, one additional occurrence of "dollar" multiplies the fitted spam odds by $e^{1.859318}$.

The logistic classifier is
$$
\widehat C^{\rm logit}(x)
=\mathbf1_{\{\widehat p(x)>1/2\}}
=\mathbf1_{\{\widehat\beta_0+x^T\widehat\beta>0\}}.
$$
The coefficients maximize the <Bernoulli logistic-regression model> likelihood over the training emails.