Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.
You're offline
Unit 4 MCQsNatural Language Processing with Classification Models
In the context of sentiment analysis using Logistic Regression, what is the primary purpose of feature extraction?
Not quite. Try another option.
Answer: To transform raw text into numerical representations like vectors
Machine learning models require numerical input. Feature extraction converts raw text data into numerical vectors that the model can process.
Question 2 of 50
Which function is used in Logistic Regression to map the output to a probability value between 0 and 1?
Not quite. Try another option.
Answer: Sigmoid Function
The sigmoid function maps any real-valued number into a value between 0 and 1, making it suitable for probability estimation in binary classification.
Question 3 of 50
When extracting features for sentiment analysis, what does a frequency dictionary typically map?
Not quite. Try another option.
Answer: (Word, Sentiment Label) pairs to the count of occurrences
In simple feature extraction for sentiment analysis, a frequency dictionary maps a pair (word, label) to the number of times that word appears in the corpus associated with that specific label.
Question 4 of 50
In a binary logistic regression classifier for sentiment analysis, if the sigmoid output h(x) >= 0.5, how is the sentiment classified?
Not quite. Try another option.
Answer: Positive
By convention in binary classification, a probability threshold of 0.5 is used. If the output probability is 0.5 or greater, the class is predicted as Positive (1).
Question 5 of 50
What is the formula for the sigmoid function, σ(z)?
Not quite. Try another option.
Answer: 1 / (1 + e^-z)
The standard formula for the sigmoid logistic function is 1 / (1 + e^-z).
Question 6 of 50
In the feature vector representation X = [1, sum_pos, sum_neg], what does the '1' usually represent?
Not quite. Try another option.
Answer: The bias unit (intercept term)
The '1' is added to the feature vector to correspond to the bias weight (theta_0) in the dot product calculation.
Question 7 of 50
Which preprocessing step is commonly performed before feature extraction to reduce the vocabulary size without losing semantic meaning?
Not quite. Try another option.
Answer: Stemming and removing stop words
Stemming reduces words to their root form (e.g., 'tuning' to 'tun'), and removing stop words eliminates common non-informative words, both reducing vocabulary size.
Question 8 of 50
What is the 'Cost Function' used in Logistic Regression generally called?
Not quite. Try another option.
Answer: Cross-Entropy Loss (Log Loss)
Logistic regression uses the Cross-Entropy (or Log Loss) function because it is convex, allowing gradient descent to find the global minimum.
Question 9 of 50
What is the goal of Gradient Descent in training a Logistic Regression model?
Not quite. Try another option.
Answer: To minimize the cost function by iteratively updating weights
Gradient Descent is an optimization algorithm used to minimize the cost function by adjusting parameters (weights) in the opposite direction of the gradient.
Question 10 of 50
In Bayes' Rule, what does P(A|B) represent?
Not quite. Try another option.
Answer: The posterior probability of A given B
P(A|B) is the conditional probability of event A occurring given that event B is true, often called the posterior.
Question 11 of 50
Why is the Naive Bayes classifier called 'Naive'?
Not quite. Try another option.
Answer: It assumes that features are independent of each other given the class
The 'naive' assumption is that the occurrence of a particular word is independent of the occurrence of other words, given the sentiment label.
Question 12 of 50
What is the formula for Bayes' Theorem?
Not quite. Try another option.
Answer: P(A|B) = P(B|A) * P(A) / P(B)
Bayes' theorem states that the posterior probability is the likelihood times the prior divided by the evidence.
Question 13 of 50
In Naive Bayes Sentiment Analysis, what is 'Laplacian Smoothing' used for?
Not quite. Try another option.
Answer: To handle words with zero probability (words not seen in training)
Laplacian smoothing adds a small count (usually 1) to all frequency counts to prevent the probability of an unseen word becoming zero, which would zero out the entire calculation.
Question 14 of 50
If a word appears in the positive corpus but not the negative corpus, what happens to its probability P(W|Negative) without smoothing?
Not quite. Try another option.
Answer: It becomes 0
Without smoothing, the frequency count is 0, so the probability calculation results in 0.
Question 15 of 50
In Logistic Regression, if the dot product θ^T * x is 0, what is the output of the sigmoid function?
Not quite. Try another option.
Answer: 0.5
e^0 is 1. The sigmoid function is 1/(1+1) = 0.5. This is typically the decision boundary.
Question 16 of 50
Which of the following describes the 'Prior Probability' P(Positive) in Naive Bayes?
Not quite. Try another option.
Answer: Probability of a document being positive based on the training set distribution
The prior P(Positive) is the ratio of the number of positive documents to the total number of documents in the training set.
Question 17 of 50
Why do we typically use Log Likelihood in Naive Bayes calculations instead of raw probabilities?
Not quite. Try another option.
Answer: To prevent numerical underflow from multiplying many small probabilities
Multiplying many small probabilities (between 0 and 1) results in extremely small numbers that computers process as zero (underflow). Using logs converts multiplication to addition.
Question 18 of 50
In the Naive Bayes inference formula, if the sum of the Log Prior and Log Likelihoods is greater than 0, the sentiment is classified as:
Not quite. Try another option.
Answer: Positive
The Log Likelihood ratio is typically defined as log(P(W|Pos)/P(W|Neg)). If the total sum including the log prior is > 0, the positive probability outweighs the negative.
Question 19 of 50
What is a 'sparse representation' in the context of NLP feature vectors?
Not quite. Try another option.
Answer: A vector where most elements are zero
When using One-Hot Encoding or large vocabulary counts, most words in the vocabulary do not appear in a single sentence, resulting in a vector mostly filled with zeros.
Question 20 of 50
Which component of the Naive Bayes classifier represents the 'Evidence' in Bayes' rule?
Not quite. Try another option.
Answer: P(Data)
The denominator P(Data) represents the evidence or marginal likelihood. In classification, it is often ignored as it is constant for all classes.
Question 21 of 50
In Logistic Regression, what is the dimension of the weight vector θ if the feature vector x has dimension V+1?
Not quite. Try another option.
Answer: V+1
To perform the dot product θ^T * x, the weight vector must have the same dimensions as the feature vector.
Question 22 of 50
Which algorithm is considered a 'Generative' model?
Not quite. Try another option.
Answer: Naive Bayes
Naive Bayes is a generative model because it models the joint probability distribution P(x, y) (how the data is generated), whereas Logistic Regression is discriminative.
Question 23 of 50
Which algorithm is considered a 'Discriminative' model?
Not quite. Try another option.
Answer: Logistic Regression
Logistic Regression is discriminative because it directly models the conditional probability P(y|x) (the boundary between classes).
Question 24 of 50
What is the 'Lambda' (λ) term in the context of Naive Bayes ratio calculation?
Not quite. Try another option.
Answer: The smoothing parameter
Lambda is the additive smoothing parameter (Laplacian smoothing) added to the numerator and denominator of probability calculations.
Question 25 of 50
When extracting features for Logistic Regression, if the word 'happy' appears 3 times in a tweet, and 'happy' has a positive frequency of 100 and negative frequency of 5 in the corpus, how is this typically utilized?
Not quite. Try another option.
Answer: The counts 100 and 5 contribute to the aggregate sums in the feature vector
In standard frequency-based feature extraction, we look up the pre-computed corpus frequencies (100, 5) and sum them into the feature vector slots for the tweet.
Question 26 of 50
What is the main advantage of Logistic Regression over Naive Bayes?
Not quite. Try another option.
Answer: It does not require independent features
Logistic Regression learns the weights of features based on their correlation with the output and does not strictly assume feature independence like Naive Bayes.
Question 27 of 50
In the context of Naive Bayes, what is V?
Not quite. Try another option.
Answer: The vocabulary size (number of unique words)
V usually denotes the size of the vocabulary, which is used in the denominator of the smoothed probability formula.
Question 28 of 50
If the learning rate in Logistic Regression is too large, what might happen?
Not quite. Try another option.
Answer: The model may overshoot the minimum and fail to converge
A large learning rate causes the gradient descent steps to be too big, potentially bouncing over the minimum cost and diverging.
Question 29 of 50
Which of the following is a hyperparameter in Logistic Regression?
Not quite. Try another option.
Answer: The learning rate α
The learning rate is set before training begins and controls the step size; weights and bias are parameters learned during training.
Question 30 of 50
How is the 'Log Prior' calculated for the positive class?
Not quite. Try another option.
Answer: log(N_pos / N_neg)
In the log-likelihood ratio formulation of Naive Bayes, the log prior is the log of the ratio of the number of positive documents to negative documents.
Question 31 of 50
What is the range of values for the output of the standard Naive Bayes probability calculation P(y|x) before applying logs?
Not quite. Try another option.
Answer: [0, 1]
Probabilities are always between 0 and 1.
Question 32 of 50
Which sentiment lexicon is purely generated from the training data in the approaches discussed?
Not quite. Try another option.
Answer: The Lambda dictionary (Log Likelihood ratios of words)
In the Naive Bayes approach, we build a dictionary of lambda values (log likelihood ratios) for each word based specifically on the frequencies observed in the training corpus.
Question 33 of 50
When predicting with Naive Bayes, if a word in the test sentence is not in the training vocabulary (V), what is the standard action?
Not quite. Try another option.
Answer: Discard it (ignore it)
Words not in the vocabulary do not have a computed likelihood ratio and typically contribute 0 to the log-sum score (i.e., they are ignored).
Question 34 of 50
What is 'Sentiment Analysis' primarily classifying?
Not quite. Try another option.
Answer: The emotional tone or opinion (e.g., Positive/Negative)
Sentiment analysis is the computational study of opinions, sentiments, and emotions expressed in text.
Question 35 of 50
In Logistic Regression, the decision boundary is:
Not quite. Try another option.
Answer: Linear
Logistic regression creates a linear decision boundary (a line or hyperplane) that separates the classes.
Question 36 of 50
The denominator for calculating P(w|class) with Laplacian smoothing is:
Not quite. Try another option.
Answer: N_class (total words in class) + V (vocabulary size)
To normalize the smoothed counts, we divide by the total number of words in the class plus the size of the vocabulary (since we added 1 for every unique word).
Question 37 of 50
What does a negative value in a word's Log Likelihood (Lambda) score imply in Sentiment Analysis?
Not quite. Try another option.
Answer: The word is indicative of Negative sentiment
Lambda is log(P(w|Pos)/P(w|Neg)). If P(w|Neg) > P(w|Pos), the ratio is < 1, and the log is negative.
Question 38 of 50
Which of the following is a stop word?
Not quite. Try another option.
Answer: The
'The' is a common article with little semantic sentiment value, classifying it as a stop word.
Question 39 of 50
In a confusion matrix for binary classification, what is a False Positive?
Not quite. Try another option.
Answer: Incorrectly predicting positive when the actual class is negative
A False Positive is an error where the model predicts the positive class, but the ground truth was actually negative.
Question 40 of 50
What is the primary reason for lowercasing text during preprocessing?
Not quite. Try another option.
Answer: To ensure 'Good' and 'good' are treated as the same feature
Lowercasing normalizes the text so that capitalization variations do not create duplicate features in the vocabulary.
Question 41 of 50
If a Logistic Regression model is overfitted, how will it perform?
Not quite. Try another option.
Answer: Well on training data, poorly on test data
Overfitting occurs when the model learns the noise in the training data, resulting in high accuracy on training but poor generalization to unseen test data.
Question 42 of 50
Which formula represents the update rule for weight θ_j in Gradient Descent?
Not quite. Try another option.
Answer: θ_j := θ_j - α * dJ/dθ_j
We subtract the product of the learning rate and the partial derivative of the cost function to move down the gradient.
Question 43 of 50
In Naive Bayes, what assumption allows us to multiply probabilities of individual words?
Not quite. Try another option.
Answer: Conditional Independence
The Naive Bayes assumption is that the probability of feature xi depends only on the class y, independent of other features xj.
Question 44 of 50
What is Tokenization?
Not quite. Try another option.
Answer: Splitting a string of text into individual words or terms
Tokenization is the process of breaking a stream of text up into words, phrases, symbols, or other meaningful elements called tokens.
Question 45 of 50
Which value of probability corresponds to the logit (log-odds) value of 0?
Not quite. Try another option.
Answer: 0.5
Log-odds = log(p / (1-p)). If p=0.5, then 0.5/0.5 = 1, and log(1) = 0.
Question 46 of 50
What is the interpretation of weights in Logistic Regression for Sentiment Analysis?
Not quite. Try another option.
Answer: They represent the importance and direction (positive/negative) of a feature
A high positive weight implies the feature strongly correlates with the positive class; a high negative weight implies correlation with the negative class.
Question 47 of 50
For a balanced dataset, which metric is most straightforward to evaluate performance?
Not quite. Try another option.
Answer: Accuracy
Accuracy (Correct Predictions / Total Predictions) is a good metric when the classes in the dataset are balanced (e.g., 50% positive, 50% negative).
Question 48 of 50
In vector space models, what is 'Oov'?
Not quite. Try another option.
Answer: Out of vocabulary
OOV stands for Out-Of-Vocabulary, referring to words encountered in testing that were not present in the training vocabulary.
Question 49 of 50
The conditional probability P(Word|Positive) is conceptually similar to:
Not quite. Try another option.
Answer: How likely the word is to appear if the sentiment is known to be Positive
This is the likelihood: given the class is Positive, what is the probability of observing this specific word.
Question 50 of 50
Which technique is essentially a 'probabilistic classifier' based on applying Bayes' theorem?
Not quite. Try another option.
Answer: Naive Bayes
Naive Bayes is explicitly founded on Bayes' theorem to calculate probabilities for classification.
That's unit 4
Answer a few questions and your score shows up here.
Nearly through. Did unit 4 of INT344 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 4 of INT344 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill;
the rest comes out of a student's own pocket: the domain, the storage, and keeping
the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.