Data and Analytics Machine Learning Fundamentals 2 — Questions and Answers
Question 1: Which algorithm builds an ensemble of decision trees using random subsets of features and training samples?
- Gradient Boosting
- Random Forest (Correct answer)
- Naive Bayes
- K-Nearest Neighbors
Correct answer: Random Forest
Random Forest creates multiple decision trees using random feature subsets and bootstrap samples, then aggregates their predictions to improve accuracy and reduce overfitting.
Question 2: In a neural network, what is the role of an activation function?
- To initialize the weights of the network
- To introduce non-linearity so the network can learn complex patterns (Correct answer)
- To reduce the number of parameters in the model
- To normalize input data before training
Correct answer: To introduce non-linearity so the network can learn complex patterns
Activation functions introduce non-linearity into neural networks, enabling them to learn and represent complex, non-linear relationships in data.
Question 3: What is gradient descent used for in machine learning?
- Selecting the best features from a dataset
- Iteratively updating model parameters to minimize the loss function (Correct answer)
- Splitting data into training and testing sets
- Measuring model performance on unseen data
Correct answer: Iteratively updating model parameters to minimize the loss function
Gradient descent is an optimization algorithm that iteratively adjusts model parameters in the direction that minimizes the loss function, guided by the gradient.
Question 4: Which type of machine learning is used in recommendation systems where an agent learns by receiving rewards or penalties?
- Supervised learning
- Unsupervised learning
- Semi-supervised learning
- Reinforcement learning (Correct answer)
Correct answer: Reinforcement learning
Reinforcement learning trains an agent to make decisions by rewarding desired actions and penalizing undesired ones, making it well-suited for sequential decision-making tasks.
Question 5: What does PCA (Principal Component Analysis) primarily accomplish in data analysis?
- Classifies data into predefined categories
- Reduces dimensionality by projecting data onto principal components (Correct answer)
- Clusters similar data points together
- Predicts a continuous target variable
Correct answer: Reduces dimensionality by projecting data onto principal components
PCA reduces the number of features by projecting data onto orthogonal axes (principal components) that capture the most variance, simplifying analysis without losing critical information.
Question 6: In logistic regression, what does the output of the sigmoid function represent?
- The exact class label for a data point
- The probability that a data point belongs to a particular class (Correct answer)
- The distance from the decision boundary
- The error rate of the model
Correct answer: The probability that a data point belongs to a particular class
The sigmoid function maps any real value to a probability between 0 and 1, representing the likelihood that an input belongs to the positive class.
Question 7: What is transfer learning in the context of deep learning?
- Sending a model from one server to another for inference
- Reusing a pre-trained model on a new but related task (Correct answer)
- Transferring data between databases for training
- Converting a model from one framework to another
Correct answer: Reusing a pre-trained model on a new but related task
Transfer learning leverages knowledge from a model trained on a large dataset and fine-tunes it for a new, related task, reducing training time and data requirements.
Which algorithm builds an ensemble of decision trees using random subsets of features and training samples?