From the course: Machine Learning with Logistic Regression in Excel, R, and Power BI
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Calculating log likelihood
From the course: Machine Learning with Logistic Regression in Excel, R, and Power BI
Calculating log likelihood
- [Instructor] Before we calculate the log likelihoods for a logistic regression model, let's think about how we would calculate the mean for a binomial distribution. The mean value for a binomial distribution with two outcomes like our model equals the probability, P that an event occurs multiplied by one plus the quantity of one minus P multiplied by zero. The second term of the formula goes to zero so the expected outcome or mean of this model equals the probability P. In order to ultimately optimize the coefficients in our logistic regression model, we first need to calculate the log likelihood for each data point and then sum them up and we'll minimize the distance when we solve the problem. I find the log likelihood function makes the most sense if I separate it into the actual outcome and the alternative outcome terms. In the first term, we multiply the actual outcome by the natural log of probability P…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Calculating linear regression3m 38s
-
(Locked)
Working with the logit model4m 42s
-
(Locked)
Calculating log likelihood5m 8s
-
(Locked)
Constructing MLE10m 30s
-
(Locked)
Solving MLE7m 53s
-
(Locked)
Predicting outcomes3m 52s
-
(Locked)
Visualizing logistic regression5m 46s
-
(Locked)
Challenge: Calculating logistic regression50s
-
(Locked)
Solution: Calculating logistic regression3m 16s
-
-
-
-
-