- Advanced Machine Learning with R
- Cory Lesmeister Dr. Sunil Kumar Chinnamgari
- 395字
- 2021-06-24 14:24:36
Logistic regression
As previously discussed, our classification problem is best modeled with the probabilities that are bound by 0 and 1. We can do this for all of our observations with some different functions, but here we'll focus on the logistic function. The logistic function used in logistic regression is as follows:

If you've ever placed a friendly wager on horse races or the World Cup, you may understand the concept better as odds. The logistic function can be turned to odds with the formulation of Probability (Y) / 1 - Probability (Y). For instance, if the probability of Brazil winning the World Cup is 20 percent, then the odds are 0.2 / 1 - 0.2, which is equal to 0.25, translating to odds of one in four.
To translate the odds back to probability, take the odds and divide by one plus the odds. The World Cup example is hence 0.25 / 1 + 0.25, which is equal to 20 percent. Additionally, let's consider the odds ratio. Assume that the odds of Germany winning the Cup are 0.18. We can compare the odds of Brazil and Germany with the odds ratio. In this example, the odds ratio would be the odds of Brazil divided by the odds of Germany. We'll end up with an odds ratio equal to 0.25/0.18, which is equal to 1.39. Here, we'll say that Brazil is 1.39 times more likely than Germany to win the World Cup.
One way to look at the relationship of logistic regression with linear regression is to show logistic regression as the log odds or log (P(Y)/1 - P(Y)) is equal to Bo + B1x. The coefficients are estimated using a maximum likelihood instead of the OLS. The intuition behind the maximum likelihood is that we're calculating the estimates for Bo and B1, which will create a predicted probability for an observation that's as close as possible to the actual observed outcome of Y, a so-called likelihood. The R language does what other software packages do for the maximum likelihood, which is to find the optimal combination of beta values that maximize the likelihood.
With these facts in mind, logistic regression is a potent technique to predict the problems involving classification and is often the starting point for model creation in such problems. Therefore, in this chapter, we'll attack the future problem with logistic regression first.
- 筆記本電腦使用、維護(hù)與故障排除實(shí)戰(zhàn)
- Learning SQL Server Reporting Services 2012
- SDL Game Development
- Mastering Delphi Programming:A Complete Reference Guide
- BeagleBone By Example
- 深入淺出SSD:固態(tài)存儲(chǔ)核心技術(shù)、原理與實(shí)戰(zhàn)(第2版)
- Svelte 3 Up and Running
- VCD、DVD原理與維修
- Internet of Things Projects with ESP32
- 單片機(jī)技術(shù)及應(yīng)用
- 基于網(wǎng)絡(luò)化教學(xué)的項(xiàng)目化單片機(jī)應(yīng)用技術(shù)
- 筆記本電腦維修技能實(shí)訓(xùn)
- FPGA實(shí)戰(zhàn)訓(xùn)練精粹
- Learning Less.js
- 微服務(wù)架構(gòu)基礎(chǔ)(Spring Boot+Spring Cloud+Docker)