> For the complete documentation index, see [llms.txt](https://windmising.gitbook.io/lihang-tongjixuexifangfa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://windmising.gitbook.io/lihang-tongjixuexifangfa/logisticregression/2.md).

# 多分类逻辑回归模型

假设Y的取值集合是${1, 2, \cdots, K}$，则

$$
\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}
$$

其中$x \in R^{n+1}$，$w\_k \in R^{n+1}$
