- Mastering Machine Learning with R(Second Edition)
- Cory Lesmeister
- 409字
- 2021-07-09 18:23:57
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 a number of different functions, but here we will focus on the logistic function. The logistic function used in logistic regression is as follows:
If you have 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 Pide by one plus the odds. The World Cup example is thus 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 Pided by the odds of Germany. We will end up with an odds ratio equal to 0.25/0.18, which is equal to 1.39. Here, we will 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 are calculating the estimates for Bo and B1, which will create a predicted probability for an observation that is 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 very powerful technique to predict the problems involving classification and is often the starting point for model creation in such problems. Therefore, in this chapter, we will attack the upcoming business problem with logistic regression first and foremost.
- 數據浪潮
- 在你身邊為你設計Ⅲ:騰訊服務設計思維與實戰
- Google Visualization API Essentials
- Effective Amazon Machine Learning
- 軟件成本度量國家標準實施指南:理論、方法與實踐
- Remote Usability Testing
- 一個64位操作系統的設計與實現
- INSTANT Android Fragmentation Management How-to
- Augmented Reality using Appcelerator Titanium Starter
- SAS金融數據挖掘與建模:系統方法與案例解析
- Unity 2018 By Example(Second Edition)
- 數據庫原理與設計實驗教程(MySQL版)
- Access 2016數據庫應用基礎
- 碼上行動:利用Python與ChatGPT高效搞定Excel數據分析
- Python金融數據挖掘與分析實戰