Logistic Regression Interview Questions

Displaying 1 - 10 of 10

What is the output of a standard MLE program?

03/23/2021 - 00:33 by devraj

The output of a standard MLE program is as follows:

Maximised likelihood value: This is the numerical value obtained by replacing the unknown parameter values in the likelihood function with the MLE parameter estimator.

Estimated variance-covariance matrix: The diagonal of this matrix consists of the estimated variances of the ML estimates. The off-diagonal consists of the covariances of the pairs of the ML estimates

What are the advantages and disadvantages of conditional and unconditional methods of MLE?

03/23/2021 - 00:32 by devraj

Conditional methods do not estimate unwanted parameters. Unconditional methods estimate the values of unwanted parameters also. Unconditional formulas can directly be developed with joint probabilities. This cannot be done with conditional probability. If the number of parameters is high relative to the number of instances, then the unconditional method will give biased results. Conditional results will be unbiased in such cases.

What are the different methods of MLE and when is each method preferred?

03/23/2021 - 00:30 by devraj

In the case of logistic regression, there are two approaches to MLE. They are conditional and unconditional methods. Conditional and unconditional methods are algorithms that use different likelihood functions. The unconditional formula employs the joint probability of positives (for example, churn) and negatives (for example, non-churn). The conditional formula is the ratio of the probability of observed data to the probability of all possible configurations.

The unconditional method is preferred if the number of parameters is lower compared to the number of instances. If the number of parameters is high compared to the number of instances, then conditional MLE is to be preferred. Statisticians suggest that conditional MLE is to be used when in doubt. Conditional MLE will always provide unbiased results.

What is the Maximum Likelihood Estimator (MLE)?

03/23/2021 - 00:28 by devraj

The MLE chooses those sets of unknown parameters (estimator) that maximise the likelihood function. The method to find the MLE is to use calculus and setting the derivative of the logistic function with respect to an unknown parameter to zero, and solving it will give the MLE. For a binomial model, this will be easy, but for a logistic model, the calculations are complex. Computer programs are used for deriving MLE for logistic models.

(Here’s another approach to answering the question.)

MLE is a statistical approach to estimate the parameters of a mathematical model. MLE and ordinary square estimation give the same results for linear regression if the dependent variable is assumed to be normally distributed. MLE does not assume anything about independent variables.

What is the formula for calculating odds ratio?

03/23/2021 - 00:23 by devraj

The formula can be given as:

OR_{X_{1}, X_{2}} = e^{\sum_{i=1}^{k} \beta_{i}(X_{1i} - X_{0i}) }

In the formula above, X1 and X0 stand for two different groups for which the odds ratio needs to be calculated. X1i stands for the instance ‘i’ in group X1. Xoi stands for the instance ‘i’ in group X0.β0 stands for the coefficient of the logistic regression model. Note that the baseline is not included in this formula.

What is odds ratio?

03/23/2021 - 00:21 by devraj

Odds ratio is the ratio of odds between two groups. For example, let’s assume that you are trying to ascertain the effectiveness of a medicine. You administered this medicine to the ‘intervention’ group and a placebo to the ‘control’ group.

                                           Odds Ratio (OR) = Odds of the Intervention Group / Odds of the Control Group

Interpretation

  • If odds ratio = 1, then there is no difference between the intervention group and the control group.
  • If the odds ratio is greater than 1, then the control group is better than the intervention group.
  • If the odds ratio is less than 1, then the intervention group is better than the control group.

How to interpret the results of a logistic regression model? Or, what are the meanings of the different betas in a logistic regression model?

03/23/2021 - 00:20 by devraj

β0 is the baseline in a logistic regression model. It is the log odds for an instance when all the attributes (X1,X2,X3,...,Xn) are zero. In practical scenarios, the probability of all the attributes being zero is very low. In another interpretation, β0 is the log odds for an instance when none of the attributes is taken into consideration.

All the other Betas are the values by which the log odds change by a unit change in a particular attribute by keeping all other attributes fixed or unchanged (control variables).

What are the outputs of the logistic model and the logistic function?

03/23/2021 - 00:11 by devraj

The logistic model outputs the logits, i.e. log odds; and the logistic function outputs the probabilities.

Logistic model =

 \beta_{0} + \beta_{1} X_{1} + \beta_{2} X_{2} + \beta_{3} X_{3} + ... + + \beta_{k} X_{k}

The output of the same will be logits.

Logistic function=f(z)=1(1+e−(β0+β1X1+β2X2+β3X3+...+βnXn))

f(z) = \frac{1}{(1 + e^{-(\beta_{0} + \beta_{1} X_{1} + \beta_{2} X_{2} + \beta_{3} X_{3} + ... + + \beta_{k} X_{k})})}

The output, in this case, will be the probabilities

Why is logistic regression very popular/widely used?

03/22/2021 - 23:57 by devraj

Logistic regression is famous because it can convert the values of logits (log-odds), which can range from −∞ to +∞ to a range between 0 and 1. As logistic functions output the probability of occurrence of an event, it can be applied to many real-life scenarios. It is for this reason that the logistic regression model is very popular. Another reason why logistic fairs in comparison to linear regression is that it is able to handle the categorical variables.

What are the differences between logistic regression and linear regression?

03/19/2021 - 22:37 by devraj

The main important differences between logistic and linear regression are:

1. Dependent/response variable in linear regression is continuous whereas, in logistic regression, it is the discrete type.

2. Cost function in linear regression minimise the error term Sum(Actual(Y)-Predicted(Y))^2 but logistic regression uses maximum likelihood method for maximising probabilities.