Saturday, November 30, 2024

Machine Learning MCQ - Effect of increasing C in soft-margin SVM

Multiple choices questions in Machine learning. Interview questions on machine learning, quiz questions for data scientist answers explained, Exam questions in machine learning, difference between soft-margin and hard-margin SVM, what is the effect of increasing the regularization parameter C in soft-margin SVM?

Machine Learning MCQ - Effect of increasing regularization parameter C in soft-margin SVM

< Previous                      

Next >

 

1. In a soft-margin Support Vector Machine (SVM), if we increase C, which of the following are likely to happen?

a) The margin will grow wider

b) Most non-zero slack variables will grow

c) The norm |w| will grow larger        

d) There will be more points inside the margin

Answer: (c) The norm |w| will grow larger

The norm of the weight vector w in SVM is inversely related to the margin. The larger C is, the smaller the margin tends to be because the optimization focuses more on minimizing the slack variables than on maximizing the margin. This typically leads to a larger norm of w since it needs to be adjusted more finely to accommodate the penalties introduced by the slack variables.

 

Why not option (a)? - As the value of C increases, the width of the margin typically decreases, as the model becomes more focused on correctly classifying training samples rather than maximizing the margin.

Increase in C value makes the optimization process to focus more on minimizing classification errors. This often leads to a narrower margin, as the model may allow less flexibility in how far the support vectors are from the decision boundary to ensure that most (or all) training points are correctly classified. You will be overfitting the data because SVM will try to classify every point correctly and it cannot be done by increasing the margin.

 

Why not option (b)? – Most non-zero slack variable will shrink. For points that are already misclassified or have slack variables greater than zero, increasing C forces the optimizer to reduce the slack as much as possible, because the penalty for having non-zero slack increases.

 

Why not option (d)? - As the value of C increases, the width of the margin typically decreases, and hence we cannot have more points inside the margin.

 

Difference between soft margin and hard margin

  • Hard margin SVM is applicable for linearly separable data.
  • Soft margin SVM is applicable for non-linear data.

 

 

< Previous                      

Next >

 

 

************************

Related links:

What is the difference between soft margin SVM and hard margin SVM?

What is the effect of increasing the regularization parameter C in soft-margin SVM?

Why does the width of the margin decreases while increasing C in soft-margin SVM?

Why does the norm of the weight vector grows in soft-margin SVM due to the increase in regularization parameter C?

Define soft margin SVM

Machine learning solved mcq, machine learning solved mcq 

 

Tuesday, November 26, 2024

Machine Learning MCQ - Generative vs Discriminative models

Multiple choices questions in Machine learning. Interview questions on machine learning, quiz questions for data scientist answers explained, Exam questions in machine learning, difference between generative and discriminative ML models, why naive bayes a generative model?

Machine Learning MCQ - Why Naive Bayes classifier is a generative model?

< Previous                      

Next >

 

1. Which is true about generative and discriminative models?

a) Generative models model the joint distribution P(class = C AND sample = x)

b) Perceptron is a generative model

c) Logistic regression is a generative model

d) The naive Bayes classifier is a generative model

 

Answer: (a) Generative models model the joint distribution P(class = C AND sample = x) and (d) The naive Bayes classifier is a generative model

(a) Generative models model the joint distribution

The joint distribution P(X,Y) is the probability distribution that describes how the features X and the labels Y are distributed together. It gives us the probability of observing a particular combination of features X and the associated class label Y simultaneously.

The generative models are those that model the joint distribution because they aim to describe the probabilistic relationship between both the input data (features) and the output label (class), together. In other words, generative models try to understand how the data is generated in the context of both the features and the labels.

 

(d) Naïve Bayes is generative model

Naive Bayes is generative because it models how the data (features and labels) are generated. Specifically, it models the joint probability P(X,Y) by assuming a probabilistic process where the features are generated given the class label. It then uses Bayes' theorem to compute the posterior probability of the class, making it a generative model that focuses on how the data comes together. This contrasts with discriminative models, which directly model the decision boundary without modeling how the data is generated.

Suppose that you are using Naïve Bayes to classify emails as ‘spam’ or ‘not spam’. In this classification, the Naive Bayes model has "generated" a probabilistic model of the features (words) conditioned on the class (spam or not spam). That is it calculates the likelihood of observing words given the class [P(word|spam) and P(word|no spam)]. This is why it’s considered generative.

 

Logistic regression is a discriminative model which focuses on directly modeling the decision boundary of classes based on estimating the conditional probability which is P(Y|X).

Perceptron is a discriminative model.

 

< Previous                      

Next >

 

 

************************

Related links:

Why naive bayes is a generative classifier?

Generative vs discriminative machine learning algorithm

Why perceptron is a discriminative classifier?

Why logistic regression is a discriminative classifier?

generative model uses joint probability distribution whereas discriminative model uses the conditional probability distribution

Machine learning solved mcq, machine learning solved mcq 

 

Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents