Showing posts with label Machine Learning Quiz. Show all posts
Showing posts with label Machine Learning Quiz. Show all posts

Monday, November 3, 2025

Model Validation in Machine Learning – 10 HOT MCQs with Answers

✔ Scroll down and test yourself — answers are hidden under the “View Answer” button.


Model Validation in Machine Learning – 10 HOT MCQs with Answers | Cross-Validation, Hold-Out & Nested CV Explained


1. A data scientist performs 10-fold cross-validation and reports 95% accuracy. Later, they find that data preprocessing was applied after splitting. What does this imply?

A. Accuracy is still valid
B. Accuracy may be optimistically biased
C. Folds were too small
D. It prevents data leakage

Answer: B
Explanation: Preprocessing after splitting can leak info from validation folds into training folds, inflating accuracy. That is, preprocessing after splitting can systematically overestimate model performance due to data leakage.

When data preprocessing—such as scaling, normalization, or feature selection—is applied after splitting (i.e., on the entire dataset before dividing into folds), information from the validation/test set can inadvertently leak into the training process. This leakage inflates the measured performance, causing results like the reported 95% accuracy to be higher than what the model would achieve on truly unseen data. This is a well-known issue in cross-validation and machine learning validation.

Correct procedure of data preprocessing in cross-validation

Proper practice is to split the data first, then apply preprocessing separately to each fold to avoid biasing results.

For each fold:

  1. Split → Training and Validation subsets

  2. Fit preprocessing only on training data

  3. Transform both training and validation sets

  4. Train model

  5. Evaluate


2. Which validation strategy most likely overestimates model performance?

A. Nested cross-validation
B. Random train/test split without stratification
C. Cross-validation on dataset used for feature selection
D. Stratified k-fold

Answer: C
Explanation: Feature selection before CV leaks validation data info, inflating scores. If you perform feature selection on the entire dataset before cross-validation, the model has already “seen” information from all samples (including what should be test data).
  • This causes data leakage,
  • which makes accuracy look higher than it truly is,
  • hence the performance is overestimated.
More explanation: This happens because when feature selection is carried out on the entire dataset before performing cross-validation, information from test folds leaks into the training process. This makes accuracy estimates unrealistically high and not representative of unseen data. Feature selection should always be nested inside the cross-validation loop — i.e., done within each training subset.
3. After tuning using 5-fold CV, how should you report final accuracy?

A. CV average
B. Retrain on full data and test on held-out test set
C. Best fold score
D. Validation score after tuning

4. Why might Leave-One-Out CV lead to high variance?

A. Too little training data
B. Needs resampling 
C. Fold too large
D. Almost all data used for training

5. When should Time Series CV be used?

A. Independent samples
B. Predicting future from past
C. Imbalanced data
D. Faster training

Answer: B

Explanation:
Time Series CV preserves temporal order to avoid lookahead bias. Use Time Series Cross-Validation when the data have a temporal order, and you want to predict future outcomes from past patterns without data leakage.

Time Series Cross-Validation (TSCV) is used when data points are ordered over time — for example, stock prices, weather data, or sensor readings.

  • The order of data matters.
  • Future values depend on past patterns.
  • You must not shuffle the data, or it will leak future information.

Unlike standard k-fold cross-validation, TSCV respects the chronological order and ensures that the model is trained only on past data and evaluated on future data, mimicking real-world forecasting scenarios.

6. Performing many random 80/20 splits and averaging accuracy is called:

A. Bootstrapping
B. Leave-p-out
C. Monte Carlo Cross-Validation
D. Nested CV

Answer: C

Explanation: Monte Carlo validation averages performance over multiple random splits.

Monte Carlo Cross-Validation (also known as Repeated Random Subsampling Validation) involves randomly splitting the dataset into training and testing subsets multiple times (e.g., 80% training and 20% testing).

The model is trained and evaluated on these splits repeatedly, and the results (such as accuracy) are averaged to estimate the model's performance.

This differs from k-fold cross-validation because the splits are random and may overlap — some data points might appear in multiple test sets or not appear at all in some iterations.

When is Monte Carlo Cross-Validation useful?

  • You have limited data but want a more reliable performance estimate.
  • You want flexibility in training/test split sizes.
  • The dataset is large, and full k-fold CV is too slow.
  • You don’t need deterministic folds.
  • The data are independent and identically distributed (i.i.d.).
7. Model performs well in CV but poorly on test set. Why?

A. Too many folds
B. Overfitting during tuning
C. Underfitted model
D. Large test set

8. Which gives most reliable generalization estimate with extensive tuning?

A. Single 80/20 split
B. Nested CV
C. Stratified 10-fold
D. Leave-One-Out

Answer: B
Explanation: Nested CV separates tuning and evaluation, avoiding bias. When you perform extensive hyperparameter tuning, use Nested Cross-Validation to get the most reliable, unbiased estimate of true generalization performance.

How does Nested CV handle optimistic bias?

In standard cross-validation, if the same data is used both to tune hyperparameters and to estimate model performance, it can lead to an optimistic bias. That is, the model "sees" the validation data during tuning, which inflates performance estimates but does not truly represent how the model will perform on new unseen data. 
Nested CV solves this by separating the tuning and evaluation processes into two loops: 
  • Inner loop: Used exclusively to tune the model's hyperparameters by cross-validation on the training data. 
  • Outer loop: Used to evaluate the generalized performance of the model with the tuned hyperparameters on a held-out test fold that was never seen during the inner tuning. 
This structure ensures no data leakage between tuning and testing phases, providing a less biased, more honest estimate of how the model will perform in real-world scenarios. 

When to use Nested Cross-Validation?

Nested CV is computationally expensive. It is recommended especially when you do extensive hyperparameter optimization to avoid overfitting in model selection and get a realistic estimate of true model performance.
9. Major advantage of k-fold CV over simple hold-out?

A. Ensures higher accuracy
B. Eliminates overfitting
C. Uses full dataset efficiently
D. Requires less computation

10. What best describes the purpose of model validation?

A. Improve training accuracy
B. Reduce dataset size
C. Reduce training time
D. Measure generalization to unseen data

Answer: D
Explanation: Validation estimates generalization performance before final testing.






Sunday, November 2, 2025

Top Machine Learning MCQs with Answers | AI, Data Science & Python Interview Questions


Top Machine Learning MCQs with Answers | AI, Data Science & Python Interview Questions


Introduction:
Welcome to the complete index of Machine Learning MCQs with Answers — your one-stop resource for quick revision, interview preparation, and AI certification practice. This page organizes topic-wise MCQs on essential concepts such as Python for Data Science, Supervised and Unsupervised Learning, Support Vector Machines (SVM), Decision Trees, Deep Learning, Regression, Feature Selection, and Model Evaluation. Whether you are preparing for a Machine Learning interview, pursuing a Data Science certification course, or exploring online AI training, these quizzes will strengthen your theoretical and practical knowledge. Bookmark this page for continuous updates and new question sets covering the latest AI, SQL, and Python optimization techniques.

Machine Learning MCQs Index – AI, Data Science & Python Quiz Collection



Machine Learning training MCQs

Machine Learning testing MCQs

Linear regression MCQsDecision tree MCQsSupport Vector Machine (SVM) MCQs

Machine Learning - model validation MCQs

Neural network MCQs
Testing and evaluation MCQs
Feature selection MCQs
Principal Component Analysis MCQs
Clustering MCQs


 

Wednesday, October 29, 2025

Top 10 ML MCQs on SVM Concepts (2025 Edition)

✔ Scroll down and test yourself — answers are hidden under the “View Answer” button.

Top 10 New MCQs on SVM Concepts (2025 Edition) | Explore Database

Top 10 New MCQs on SVM Concepts (2025 Edition)

1. Which of the following best describes the margin in an SVM classifier?

A. Distance between two closest support vectors
B. Distance between support vectors of opposite classes
C. Distance between decision boundary and the nearest data point of any class
D. Width of the separating hyperplane


2. In soft-margin SVM, the penalty parameter C controls what?

A. The kernel function complexity
B. The balance between margin width and classification errors
C. The learning rate during optimization
D. The dimensionality of transformed space


3. Which of the following statements about the kernel trick in SVM is true?

A. It explicitly computes higher-dimensional feature mappings
B. It avoids computing transformations by using inner products in the feature space
C. It can only be applied to linear SVMs
D. It reduces the number of support vectors required


4. Which step is unique to non-linear SVMs?


A. Feature normalization
B. Slack variable introduction
C. Kernel trick application
D. Margin maximization


5. If the data is perfectly linearly separable, what is the ideal value of C?


A. Very small (close to 0)
B. Moderate (around 1)
C. Very large (→ ∞)
D. Exactly equal to margin value


6. Which optimization problem does SVM solve during training?


A. Minimization of loss function via gradient descent
B. Maximization of likelihood function
C. Quadratic optimization with linear constraints
D. Linear programming without constraints


7. What is the primary reason for using a kernel function in SVM?


A. To increase training speed
B. To handle non-linear relationships efficiently
C. To reduce the number of features
D. To minimize overfitting automatically


8. In SVM, support vectors are:


A. All training samples
B. Only samples lying on the margin boundaries
C. Samples inside the margin or misclassified
D. Both B and C


9. When the gamma (γ) parameter of an RBF kernel is too high, what typically happens?


A. The decision boundary becomes smoother
B. Model generalizes better
C. Model overfits by focusing on nearby points
D. Model underfits with large bias


10. Which of the following metrics is most relevant for evaluating SVM on imbalanced datasets?


A. Accuracy
B. Precision and Recall
C. Log-loss
D. Margin width



For deeper understanding, learners can explore machine learning training with placement opportunities or online SVM courses.

Machine learning specialization courses

SVM interview questions 2025

These questions are ideal for those preparing for machine learning certification exams or AI engineer job interviews.

AI engineer skills and salary

AI engineers with expertise in SVM and deep learning earn competitive salaries in 2025, especially in data-driven industries.







Tuesday, October 28, 2025

Top 10 Machine Learning Testing Stage MCQs with Answers (2025 Updated)

✔ Scroll down and test yourself — answers are hidden under the “View Answer” button.

Top 10 Machine Learning Testing Stage MCQs with Answers (2025 Updated)

Top 10 Machine Learning Testing Stage MCQs with Answers (2025 Updated)

1. What is the primary purpose of the testing stage in a machine learning workflow?

A. To tune model hyperparameters
B. To evaluate model performance on unseen data
C. To collect additional labeled data
D. To select the best optimization algorithm


2. During testing, why must the test dataset remain untouched during training and validation?

A. It helps speed up model convergence
B. It ensures the model learns from all available data
C. It prevents data leakage and gives an unbiased estimate of performance
D. It improves the model’s interpretability


3. If a model performs well on validation data but poorly on test data, what does this most likely indicate?

A. Data leakage in training
B. Overfitting to the validation set
C. Underfitting to the training set
D. Insufficient regularization in test data


4. Which metric is least

A. Precision
B. Recall
C. Accuracy
D. F1-score


5. In model evaluation, what does a large difference between training and test accuracy typically indicate?

A. The model is well-calibrated
B. The model is overfitting
C. The model is generalizing well
D. The dataset is balanced


6. Which of the following statements about test data is TRUE?

A. Test data should be augmented the same way as training data
B. Test data should be collected after the model is deployed
C. Test data should be used for hyperparameter tuning
D.  Test data should come from the same distribution as training data but remain unseen


7. In cross-validation, what plays the role of the test set in each fold?

A. The validation split of each fold
B. The training split of each fold
C. The combined training and validation splits
D. A completely new dataset


8. Which evaluation method best simulates real-world testing conditions for time-series models?

A. Random K-fold cross-validation
B. Leave-one-out validation
C. Rolling window validation
D. Stratified sampling


9. Why is the test stage essential before model deployment in real applications?

A. It confirms that the model architecture is optimal
B. It ensures low training loss
C. It verifies generalization ability under unseen scenarios
D. It automatically adjusts hyperparameters


10. What is a common mistake made during the testing phase of ML models?

A. Using standard metrics like RMSE
B. Using separate data splits
C. Measuring inference speed
D. Using test data for model selection




Go to TOP 10 MCQs in Machine Learning - Home page 

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