官术网_书友最值得收藏!

Logistic regression for multiclass classification

When more than two classes are involved, logistic regression is known as multinomial logistic regression. In multinomial logistic regression, instead of sigmoid, use the softmax function, which can be described mathematically as follows:

The softmax function produces the probabilities for each class so that the probabilities vector adds up to 1. At the time of inference, the class with the highest softmax value becomes the output or predicted class. The loss function, as we discussed earlier, is the negative log-likelihood function, -l(w)that can be minimized by the optimizers, such as gradient descent.

The loss function for multinomial logistic regression is written formally as follows:

Here, ?(z) is the softmax function.

We will implement this loss function in the next section. In the following section, we will dig into our example for multiclass classification with logistic regression in TensorFlow.

主站蜘蛛池模板: 临沧市| 辽宁省| 高清| 乐至县| 丰宁| 襄汾县| 永春县| 兴业县| 江门市| 民乐县| 乌鲁木齐县| 木兰县| 肇东市| 安吉县| 交城县| 仁怀市| 山东省| 淮南市| 嘉善县| 延安市| 漯河市| 扎鲁特旗| 江城| 揭东县| 抚远县| 繁峙县| 衡水市| 平乐县| 邢台县| 儋州市| 奉化市| 榕江县| 鸡泽县| 上杭县| 芒康县| 蛟河市| 大余县| 越西县| 吴旗县| 腾冲县| 勐海县|