DAC Machine Learning & Predictive Analytics 1 — Questions and Answers
Question 1: Which machine learning algorithm is best suited for classifying emails as spam or not spam?
- K-Means Clustering
- Naïve Bayes (Correct answer)
- Linear Regression
- Principal Component Analysis (PCA)
Correct answer: Naïve Bayes
Naïve Bayes is a probabilistic machine learning algorithm based on Bayes' theorem, commonly used for classification tasks, especially text classification. It is highly effective for classifying emails as spam or not spam because it can quickly learn from the presence or absence of specific words and features within an email. Its simplicity and efficiency make it a popular choice for this application.
Question 2: What is the purpose of cross-validation in machine learning?
- To prevent overfitting (Correct answer)
- To make the model train faster
- To increase data storage capacity
- To add more hidden layers to neural networks
Correct answer: To prevent overfitting
Cross-validation is a crucial technique in machine learning used to assess how well a model generalizes to new, unseen data. By training and testing the model on different subsets of the data, it helps detect and prevent overfitting. Overfitting occurs when a model learns the training data too well, including noise, and performs poorly on new data.
Question 3: Which metric is commonly used to evaluate the performance of a regression model?
- Mean Squared Error (MSE) (Correct answer)
- F1 Score
- Confusion Matrix
- Precision
Correct answer: Mean Squared Error (MSE)
Mean Squared Error (MSE) is a widely used metric to evaluate the performance of regression models. It calculates the average of the squared differences between the predicted values and the actual values. MSE quantifies the average magnitude of the errors, with lower values indicating a better fit of the model to the data.
Question 4: What is the main goal of feature scaling in machine learning?
- To increase dataset size
- To make numerical features comparable (Correct answer)
- To remove duplicate records
- To add more categorical variables
Correct answer: To make numerical features comparable
The main goal of feature scaling in machine learning is to transform numerical features so they have a similar range or distribution. This prevents features with larger values from dominating the learning process, ensuring that all features contribute equally to the model's performance. It is particularly important for algorithms sensitive to feature magnitudes, such as K-Nearest Neighbors or Support Vector Machines.
Question 5: Which of the following is an unsupervised learning algorithm?
- Decision Trees
- Support Vector Machines (SVM)
- K-Means Clustering (Correct answer)
- Logistic Regression
Correct answer: K-Means Clustering
K-Means Clustering is an unsupervised learning algorithm that groups data points into 'k' clusters based on their similarity. Unlike supervised learning, it does not require labeled data, making it ideal for discovering inherent structures or patterns within a dataset. It aims to partition data into clusters where each data point belongs to the cluster with the nearest mean.
Question 6: Which technique is commonly used to reduce dimensionality in machine learning?
- Bagging
- Boosting
- Principal Component Analysis (PCA) (Correct answer)
- Random Forest
Correct answer: Principal Component Analysis (PCA)
Principal Component Analysis (PCA) is a powerful statistical technique commonly used for dimensionality reduction in machine learning. It transforms high-dimensional data into a lower-dimensional representation while retaining most of the original variance. PCA helps simplify models, reduce computational cost, and mitigate the curse of dimensionality by identifying the most important features.
Which machine learning algorithm is best suited for classifying emails as spam or not spam?