Podcast
Questions and Answers
Explain two ways a GLM generalizes a linear model.
Explain two ways a GLM generalizes a linear model.
Distribution of the target variable: The target variable in a GLM can now belong to the exponential family of distributions that include a number of continuous and discrete distributions. The distributions include Binomial, Poisson, Normal, Gamma, and inverse Gaussian. Relationship between the target mean and linear predictor: GLM uses a “link function” to set the target mean µ to the linear combination of predictors.
Explain why a linear model can be regarded as a special case of a GLM.
Explain why a linear model can be regarded as a special case of a GLM.
In the special case of a GLM where the target variable is normally distributed and the link function is the identity function g(µ) = μ, we are back to the linear model. In this sense, GLM is a “generalized” version of a linear model.
Describe the characteristics of a Tweedie distribution.
Describe the characteristics of a Tweedie distribution.
It is a Poisson sum of Gamma random variables. It has a discrete probability at mass zero and a probability density function on the positive real line.
Explain whether or not the log link can be used when some of the observations of the target variable are zero.
Explain whether or not the log link can be used when some of the observations of the target variable are zero.
Explain two differences between weights and offsets when applied to GLM.
Explain two differences between weights and offsets when applied to GLM.
State the statistical method typically used to estimate the parameters of GLM.
State the statistical method typically used to estimate the parameters of GLM.
Explain the problem with deviance as a model selection criterion.
Explain the problem with deviance as a model selection criterion.
Explain the limitations of the likelihood ratio test as a model selection method.
Explain the limitations of the likelihood ratio test as a model selection method.
Explain how regularization for GLM works.
Explain how regularization for GLM works.
Explain the importance of setting a cutoff for a binary classifier.
Explain the importance of setting a cutoff for a binary classifier.
Explain the relationship between accuracy, sensitivity, and specificity.
Explain the relationship between accuracy, sensitivity, and specificity.
Explain how the cutoff of a binary classifier affects the sensitivity and specificity.
Explain how the cutoff of a binary classifier affects the sensitivity and specificity.
Explain the problem with unbalanced data.
Explain the problem with unbalanced data.
Explain how undersampling and oversampling work to make unbalanced data more balanced.
Explain how undersampling and oversampling work to make unbalanced data more balanced.
Explain why oversampling must be performed after splitting the full data into training and test data.
Explain why oversampling must be performed after splitting the full data into training and test data.
Explain one reason for using oversampling over undersampling, and one reason for using undersampling over oversampling.
Explain one reason for using oversampling over undersampling, and one reason for using undersampling over oversampling.
Flashcards
How GLMs generalize linear models
How GLMs generalize linear models
GLMs generalize linear models by allowing the target variable to follow distributions from the exponential family and using a link function to relate the target mean to a linear combination of predictors.
Linear model as a GLM case
Linear model as a GLM case
A linear model is a special case of a GLM when the target variable is normally distributed and the link function is the identity function.
Tweedie distribution characteristics
Tweedie distribution characteristics
A Tweedie distribution is a Poisson sum of Gamma random variables and has a discrete probability at mass zero and a probability density function on the positive real line.
Using log link with zero values
Using log link with zero values
Signup and view all the flashcards
Weights vs. Offsets in GLM
Weights vs. Offsets in GLM
Signup and view all the flashcards
Parameter estimation
Parameter estimation
Signup and view all the flashcards
Problem with deviance
Problem with deviance
Signup and view all the flashcards
Limitations of likelihood ratio test
Limitations of likelihood ratio test
Signup and view all the flashcards
Regularization for GLMs
Regularization for GLMs
Signup and view all the flashcards
Importance of a cutoff
Importance of a cutoff
Signup and view all the flashcards
Accuracy, sensitivity, specificity links
Accuracy, sensitivity, specificity links
Signup and view all the flashcards
Cutoff effect on binary classifier
Cutoff effect on binary classifier
Signup and view all the flashcards
Problem with imbalanced data
Problem with imbalanced data
Signup and view all the flashcards
Undersampling/Oversampling in short.
Undersampling/Oversampling in short.
Signup and view all the flashcards
When should you oversample?
When should you oversample?
Signup and view all the flashcards
Oversampling vs. Undersampling: Reasons
Oversampling vs. Undersampling: Reasons
Signup and view all the flashcards
Study Notes
Generalizing Linear Models with GLMs
- GLMs broaden linear models by allowing target variables to follow exponential family distributions, including continuous and discrete types like Binomial, Poisson, Normal, Gamma, and inverse Gaussian
- GLMs use a "link function" to relate the target mean to a linear combination of predictors
GLMs as Generalizations of Linear Models
- A GLM simplifies to a linear model when the target variable is normally distributed and uses an identity link function where g(µ) = µ
Characteristics of Tweedie Distribution
- Tweedie distributions are Poisson sums of Gamma random variables
- They exhibit a discrete probability at mass zero with a probability density function on the positive real line
Zero Values in Target Variables and Log Links
- Zero values in some target variables do not automatically invalidate the use of a log link
- Log link is applied to the target mean, not directly to the observations
- Distributions like Gamma and inverse Gaussian require adjustments to handle zero values, but Poisson accommodates them
Weights vs. Offsets in GLMs
- For weights, the target variable should be averaged by exposure
- For offsets, the observations are values aggregated over the exposure units
- Averaging causes each observation's variance to be inversely related to the size of exposure, which acts as the weight
- Weights do not appear directly in the model equation and do not affect the target mean, while offsets are directly proportional to the target mean and appear in the equation, leaving variance unaffected
Parameter Estimation Method for GLMs
- Maximum Likelihood Estimation (MLE) estimates parameters to maximize the likelihood of observed data
- This is typically achieved via optimization algorithms
Deviance as a Model Selection Criterion
- Deviance in GLMs is similar to Residual Sum of Squares (RSS) in linear models
- It measures the goodness-of-fit on the training set
- Deviance decreases with added predictors
Limitations of Likelihood Ratio Test
- Likelihood ratio tests can only compare one pair of GLMs at a time
- The simpler GLM must be a special case of the more complex one
Regularization in GLMs
- Regularization in GLMs minimizes a penalized objective function using deviance instead of RSS
Importance of Setting a Cutoff for Binary Classifiers
- Binary classifiers predict the probability of an event
- A pre-specified cutoff is necessary to translate probabilities into predicted classes
Accuracy, Sensitivity, and Specificity
- Accuracy is a weighted average of sensitivity and specificity
- Weights are determined by the proportions of observations in each class
Cutoff Effect on Sensitivity and Specificity
- The cutoff selection involves a trade-off between sensitivity and specificity
- Setting a cutoff of 0 predicts all outcomes as positive, resulting in sensitivity of 1 and specificity of 0
- Setting a cutoff of 1 predicts all outcomes as negative, resulting in sensitivity of 0 and specificity of 1
Problem of Unbalanced Data
- Classifiers can implicitly overweight the majority class, focusing on training observations from that class and neglecting the minority class
- This is an issue if the minority class is the class of interest
Balancing Unbalanced Data with Undersampling and Oversampling
- Undersampling reduces observations from the negative class while keeping all positive observations, but the classifier might be less robust and prone to overfitting due to reduced data
- Oversampling retains all original data while oversampling the positive class with replacement
Timing of Oversampling
- Oversampling must occur after splitting data into training/test sets
- If done beforehand, the test set may not be truly unseen because observations may appear in both sets
Reasons for Choosing Oversampling or Undersampling
- Oversampling is preferable for retaining full information about the negative class
- Undersampling is preferable for easing computational load and reducing runtime when training data is very large
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.