假设Y的取值集合是1,2,⋯,K{1, 2, \cdots, K}1,2,⋯,K,则
P(Y=k∣x)=exp(wk⋅x)1+∑k=1K−1exp(wk⋅x)P(Y=K)=11+∑k=1K−1exp(wk⋅x) \begin{aligned} P(Y=k|x) = \frac{\exp (w_k \cdot x)}{1+\sum_{k=1}^{K-1}exp(w_k \cdot x)} \\ P(Y=K) = \frac{1}{1+\sum_{k=1}^{K-1}exp(w_k \cdot x)} \end{aligned} P(Y=k∣x)=1+∑k=1K−1exp(wk⋅x)exp(wk⋅x)P(Y=K)=1+∑k=1K−1exp(wk⋅x)1 其中x∈Rn+1x \in R^{n+1}x∈Rn+1,wk∈Rn+1w_k \in R^{n+1}wk∈Rn+1