0
0
ML Pythonprogramming~5 mins

Logistic regression in ML Python - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the main purpose of logistic regression?
Logistic regression is used to predict the probability of a binary outcome, like yes/no or true/false, based on input features.
Click to reveal answer
beginner
What function does logistic regression use to map predictions to probabilities?
It uses the sigmoid function, which takes any number and squashes it into a value between 0 and 1, representing a probability.
Click to reveal answer
intermediate
Explain the difference between linear regression and logistic regression.
Linear regression predicts continuous values, while logistic regression predicts probabilities for categories (usually two classes). Logistic regression uses the sigmoid function to convert linear outputs into probabilities.
Click to reveal answer
intermediate
What metric is commonly used to measure the performance of a logistic regression model?
Accuracy is common, but also log loss (cross-entropy loss) is used because it measures how close the predicted probabilities are to the actual labels.
Click to reveal answer
advanced
Why do we use the log-odds (logit) in logistic regression?
The log-odds transform the probability into a continuous value that can be modeled as a linear combination of features, making it easier to fit with linear methods.
Click to reveal answer
What output does logistic regression produce?
AA probability between 0 and 1
BA continuous number without limits
CA categorical label directly
DA cluster assignment
Which function is used in logistic regression to convert linear predictions to probabilities?
ASigmoid
BSoftmax
CTanh
DReLU
Which loss function is typically minimized in logistic regression training?
AMean squared error
BCross-entropy loss
CHinge loss
DAbsolute error
Logistic regression is best suited for which type of problem?
APredicting house prices
BReducing data dimensions
CClustering customers
DClassifying emails as spam or not spam
What does the term 'log-odds' refer to in logistic regression?
AThe odds of an event squared
BThe logarithm of the probability
CThe logarithm of the odds ratio of an event happening
DThe inverse of the probability
Describe how logistic regression predicts the class of a new data point.
Explain why logistic regression uses the sigmoid function instead of a linear function for classification.