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

Logistic regression for binary classification

For binary classification, the model function ?(z) is defined as the sigmoid function, which can be described as follows:

The sigmoid function transforms the y value to be between the range [0,1]. Thus, the value of y=?(z) can be used to predict the class: if y > 0.5, then the object belongs to 1, otherwise the object belongs to 0.

The model training means to search for the parameters that minimize the loss function, which can either be the sum of squared errors or the sum of mean squared errors. For logistic regression, the likelihood is maximized as follows:

 

However, as it is easier to maximize the log-likelihood, we use the log-likelihood (l(w)as the cost function. The loss function (J(w)) is written as -l(w), and can be minimized by using optimization algorithms such as gradient descent.

The loss function for binary logistic regression is written mathematically as follows:

Here, ?(z) is the sigmoid function.

主站蜘蛛池模板: 揭西县| 永城市| 大田县| 江达县| 灵台县| 钟山县| 彭水| 云梦县| 黔江区| 昭平县| 洛扎县| 治多县| 阿尔山市| 西丰县| 高雄市| 磐安县| 包头市| 浦北县| 大名县| 常宁市| 昌宁县| 海口市| 秀山| 福建省| 张家界市| 台南市| 望奎县| 杭州市| 土默特右旗| 永丰县| 丹东市| 原阳县| 宁河县| 泰州市| 洪泽县| 望都县| 九龙县| 含山县| 马关县| 兴文县| 镇沅|