practice_paper_2

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 10

1. In NumPy, what does the `np.argmax()` function do?

a) Returns the maximum value in an array


b) Returns the index of the maximum value in an array
c) Returns the mean of an array
d) Returns the variance of an array
Answer: b) Returns the index of the maximum value in an array

2. What is the purpose of the `np.newaxis` attribute in NumPy?


a) It adds a new axis to an array
b) It removes an axis from an array
c) It reshapes an array
d) It normalizes an array
Answer: a) It adds a new axis to an array

3. In Pandas, what does the `fillna()` function do?


a) Fills missing values in a DataFrame with specified values
b) Removes missing values from a DataFrame
c) Fills missing values in a DataFrame with the mean of the column
d) Interpolates missing values in a DataFrame
Answer: a) Fills missing values in a DataFrame with specified values

4. Which of the following statements about Matplotlib is true?


a) Matplotlib is primarily used for data manipulation
b) Matplotlib is a high-level neural networks library
c) Matplotlib provides a MATLAB-like interface for plotting
d) Matplotlib is built on top of Pandas
Answer: c) Matplotlib provides a MATLAB-like interface for plotting

5. What does the `hue` parameter control in Seaborn plots?


a) The size of the plot markers
b) The color of the plot markers
c) The style of the plot markers
d) The grouping variable for plotting observations
Answer: d) The grouping variable for plotting observations

6. In linear regression, what does the term "residuals" refer to?


a) The difference between predicted and actual values
b) The slope of the regression line
c) The intercept of the regression line
d) The variance of the dependent variable
Answer: a) The difference between predicted and actual values

7. Which of the following is true about logistic regression?


a) It is used for predicting continuous values
b) It is a linear regression algorithm
c) It is a classification algorithm
d) It is not suitable for binary classification tasks
Answer: c) It is a classification algorithm

8. In SVM, what is the role of the kernel function?


a) It determines the margin of the decision boundary
b) It transforms the input data into a higher-dimensional space
c) It calculates the distance between support vectors
d) It regularizes the SVM model
Answer: b) It transforms the input data into a higher-dimensional space

9. What is the purpose of pruning in decision trees?


a) To reduce overfitting by removing parts of the tree that do not provide
significant splits
b) To increase model complexity
c) To improve accuracy by adding more branches to the tree
d) To speed up the training process
Answer: a) To reduce overfitting by removing parts of the tree that do not
provide significant splits

10. What is the primary goal of PCA?


a) To increase the dimensionality of the data
b) To decrease the dimensionality of the data
c) To add noise to the data
d) To transform categorical variables into numerical ones
Answer: b) To decrease the dimensionality of the data

11. In neural networks, what is the purpose of the activation function?


a) To normalize the input data
b) To introduce non-linearity
c) To compute the loss function
d) To regularize the model
Answer: b) To introduce non-linearity

12. What is the role of the loss function in training neural networks?
a) To compute the accuracy of the model
b) To determine the learning rate
c) To measure the difference between predicted and actual values
d) To initialize the weights of the network
Answer: c) To measure the difference between predicted and actual values

13. Which of the following is a common activation function used in neural networks
for binary classification tasks?
a) ReLU (Rectified Linear Activation)
b) Sigmoid
c) Tanh (Hyperbolic Tangent)
d) Softmax
Answer: b) Sigmoid

14. What is the purpose of regularization in neural networks?


a) To increase model complexity
b) To reduce the number of features
c) To prevent overfitting
d) To speed up the training process
Answer: c) To prevent overfitting

15. Which of the following is not a common optimizer used in training neural
networks?
a) Adam
b) Gradient Descent
c) RMSprop
d) Newton's Method
Answer: d) Newton's Method

16. What is the purpose of the dropout technique in neural networks?


a) To remove outliers from the data
b) To randomly deactivate neurons during training to prevent overfitting
c) To speed up the training process
d) To increase the model's capacity
Answer: b) To randomly deactivate neurons during training to prevent
overfitting
17. Which evaluation metric is commonly used for regression tasks?
a) Accuracy
b) Precision
c) Mean Squared Error (MSE)
d) F1-score
Answer: c) Mean Squared Error (MSE)

18. Which evaluation metric is commonly used for classification tasks?


a) Mean Absolute Error (MAE)
b) R-squared
c) F1-score
d) Root Mean Squared Error (RMSE)
Answer: c) F1-score

19. What is the primary goal of K-means clustering?


a) To predict continuous values
b) To classify data into categories
c) To reduce the dimensionality of the data
d) To partition data into clusters based on similarity
Answer: d) To partition data into clusters based on similarity

20. In PCA, what does the term "explained variance" refer to?
a) The percentage of total variance explained by each principal component
b) The number of principal components in the dataset
c) The amount of noise added to the dataset
d) The number of features after dimensionality reduction
Answer: a) The percentage of total variance explained by each principal
component

21. Which of the following is true about k-fold cross-validation?


a) It divides the data into k clusters
b) It performs feature selection on the data
c) It evaluates the model's performance on multiple subsets of the data
d) It trains the model on a single subset of the data
Answer: c) It evaluates the model's performance on multiple subsets of the data

22. Which of the following techniques is used to handle class imbalance in


classification tasks?
a) Data augmentation
b) SMOTE (Synthetic Minority

Over-sampling Technique)
c) Feature scaling
d) L1 regularization
Answer: b) SMOTE (Synthetic Minority Over-sampling Technique)

23. Which of the following is a disadvantage of decision trees?


a) They can easily handle missing values
b) They are robust to outliers
c) They tend to overfit the training data
d) They are interpretable
Answer: c) They tend to overfit the training data

24. Which technique is commonly used for feature scaling in SVM?


a) Min-Max scaling
b) Standardization
c) Normalization
d) Binarization
Answer: b) Standardization
25. Which of the following is true about ensemble learning methods?
a) They cannot be used with decision trees
b) They combine the predictions of multiple models to improve performance
c) They are only applicable to regression tasks
d) They increase the risk of overfitting
Answer: b) They combine the predictions of multiple models to improve
performance

26. In PCA, what is the significance of the eigenvectors?


a) They represent the variance explained by each principal component
b) They represent the principal components of the data
c) They represent the mean of the data
d) They represent the covariance matrix of the data
Answer: b) They represent the principal components of the data

27. Which of the following is a drawback of using the elbow method to determine the
optimal number of clusters in K-means clustering?
a) It is computationally expensive
b) It requires a large amount of data
c) It may not always provide a clear indication of the optimal number of
clusters
d) It is sensitive to outliers
Answer: c) It may not always provide a clear indication of the optimal number
of clusters

28. What is the primary purpose of the Silhouette score in clustering?


a) To measure the compactness of clusters
b) To measure the separation between clusters
c) To measure the quality of cluster assignments
d) To measure the density of clusters
Answer: c) To measure the quality of cluster assignments

29. Which of the following is a disadvantage of using the RBF kernel in SVM?
a) It is not suitable for non-linearly separable data
b) It is computationally expensive
c) It requires the data to be linearly separable
d) It is not affected by the choice of hyperparameters
Answer: b) It is computationally expensive

30. Which of the following is a limitation of using PCA for dimensionality


reduction?
a) It can only handle numerical features
b) It requires the features to be independent of each other
c) It cannot capture non-linear relationships in the data
d) It is not suitable for large datasets
Answer: c) It cannot capture non-linear relationships in the data

31. Which activation function is commonly used in the output layer of a binary
classification neural network?
a) Sigmoid
b) ReLU
c) Tanh
d) Softmax
Answer: a) Sigmoid

32. Which technique can be used to combat overfitting in neural networks?


a) Increasing the number of layers
b) Decreasing the learning rate
c) Adding more neurons
d) Using dropout regularization
Answer: d) Using dropout regularization

33. What is the purpose of the learning rate in neural network optimization
algorithms?
a) To control the rate at which weights are updated during training
b) To determine the number of training epochs
c) To define the size of the input layer
d) To measure the accuracy of the model
Answer: a) To control the rate at which weights are updated during training

34. Which of the following statements about convolutional neural networks (CNNs) is
true?
a) CNNs are primarily used for sequence data
b) CNNs consist of fully connected layers only
c) CNNs automatically learn spatial hierarchies of features
d) CNNs are not suitable for image classification tasks
Answer: c) CNNs automatically learn spatial hierarchies of features

35. Which activation function is commonly used in the hidden layers of a neural
network?
a) Sigmoid
b) ReLU
c) Tanh
d) Softmax
Answer: b) ReLU

36. Which of the following is true about recurrent neural networks (RNNs)?
a) RNNs are only used for image recognition tasks
b) RNNs are not suitable for sequential data
c) RNNs have connections between neurons that form a directed cycle
d) RNNs do not suffer from the vanishing gradient problem
Answer: c) RNNs have connections between neurons that form a directed cycle

37. What is the purpose of the embedding layer in neural networks?


a) To reduce the dimensionality of the input data
b) To add noise to the input data
c) To convert categorical variables into numerical representations
d) To normalize the input data
Answer: c) To convert categorical variables into numerical representations

38. Which of the following is true about Long Short-Term Memory (LSTM) networks?
a) LSTMs do not suffer from the vanishing gradient problem
b) LSTMs have a simpler architecture compared to standard RNNs
c) LSTMs are not suitable for sequential data
d) LSTMs do not have memory cells
Answer: a) LSTMs do not suffer from the vanishing gradient problem

39. What is the purpose of the loss function in neural networks?


a) To initialize the weights of the network
b) To measure the difference between predicted and actual values
c) To determine the learning rate
d) To regularize the model
Answer: b) To measure the difference between predicted and actual values

40. Which technique is commonly used to address the vanishing gradient problem in
neural networks?
a) Batch normalization
b) Dropout regularization
c) Gradient clipping
d) Learning rate scheduling
Answer: c) Gradient clipping

41. Which of the following is a drawback of using mini-batch gradient descent?


a) It converges faster than batch gradient descent
b) It requires more memory compared to batch gradient descent
c) It is less prone to getting stuck in local minima
d) It is computationally less efficient than batch gradient descent
Answer: b) It requires more memory compared to batch gradient descent

42. Which regularization technique penalizes large weights by adding their squared
magnitude to the loss function?
a) L1 regularization
b) L2 regularization
c) Elastic Net regularization
d) Ridge regression
Answer: b) L2 regularization

43. What is the purpose of the softmax function in the output layer of a multi-
class classification neural network?
a) To normalize the output probabilities
b) To introduce non-linearity
c) To compute the loss function
d) To regularize the model
Answer

: a) To normalize the output probabilities

44. Which optimization algorithm adjusts the learning rate during training based on
the performance of the model?
a) Gradient Descent
b) Stochastic Gradient Descent (SGD)
c) Adagrad
d) Adam
Answer: d) Adam

45. Which of the following is true about transfer learning in neural networks?
a) It involves training a model from scratch for a new task
b) It does not require pre-trained models
c) It is not applicable to image recognition tasks
d) It leverages knowledge gained from training on one task to improve
performance on another task
Answer: d) It leverages knowledge gained from training on one task to improve
performance on another task

46. What is the purpose of the confusion matrix in classification tasks?


a) To measure the accuracy of the model
b) To visualize the distribution of the target variable
c) To evaluate the performance of the model on test data
d) To show the counts of true positive, true negative, false positive, and
false negative predictions
Answer: d) To show the counts of true positive, true negative, false positive,
and false negative predictions

47. Which of the following is a common technique used for handling missing data in
machine learning?
a) Dropping rows with missing values
b) Imputing missing values with the mean of the column
c) Imputing missing values with the median of the column
d) All of the above
Answer: d) All of the above

48. What is the purpose of feature scaling in machine learning?


a) To make the features more interpretable
b) To make the training process faster
c) To ensure that all features contribute equally to the model
d) To reduce the dimensionality of the data
Answer: c) To ensure that all features contribute equally to the model

49. Which of the following is a common technique used for feature selection in
machine learning?
a) Principal Component Analysis (PCA)
b) Recursive Feature Elimination (RFE)
c) Regularization
d) All of the above
Answer: d) All of the above

50. What is the purpose of hyperparameter tuning in machine learning?


a) To optimize the parameters of the model during training
b) To prevent overfitting of the model
c) To find the best values for the model's hyperparameters
d) To increase the model's capacity
Answer: c) To find the best values for the model's hyperparameters

51. Which of the following is true about cross-validation?


a) It is used to evaluate the performance of the model on unseen data
b) It involves splitting the data into training and testing sets
c) It can help prevent overfitting of the model
d) All of the above
Answer: d) All of the above

52. What is the purpose of feature engineering in machine learning?


a) To create new features from existing ones to improve model performance
b) To remove irrelevant features from the dataset
c) To standardize the features to a similar scale
d) To reduce the dimensionality of the dataset
Answer: a) To create new features from existing ones to improve model
performance

53. Which of the following is a common technique used for handling categorical
variables in machine learning?
a) One-Hot Encoding
b) Label Encoding
c) Ordinal Encoding
d) All of the above
Answer: d) All of the above

54. Which of the following is a common preprocessing step in natural language


processing (NLP)?
a) Tokenization
b) Standardization
c) Imputation
d) Principal Component Analysis (PCA)
Answer: a) Tokenization

55. What is the primary goal of sentiment analysis in NLP?


a) To classify text into different categories
b) To extract named entities from text
c) To determine the sentiment expressed in text
d) To generate text based on a given prompt
Answer: c) To determine the sentiment expressed in text

56. Which of the following is a common technique used for text vectorization in
NLP?
a) Bag of Words (BoW)
b) Principal Component Analysis (PCA)
c) Support Vector Machines (SVM)
d) K-means clustering
Answer: a) Bag of Words (BoW)

57. What is the purpose of the IDF (Inverse Document Frequency) term in TF-IDF
vectorization?
a) To measure the frequency of a term in a document
b) To measure the importance of a term in a collection of documents
c) To normalize the term frequencies in a document
d) To compute the cosine similarity between documents
Answer: b) To measure the importance of a term in a collection of documents

58. Which of the following is true about word embeddings?


a) Word embeddings represent words as dense vectors in a high-dimensional space
b) Word embeddings are sparse representations of words
c) Word embeddings are generated using one-hot encoding
d) Word embeddings are not suitable for NLP tasks
Answer: a) Word embeddings represent words as dense vectors in a high-
dimensional space

59. What is the purpose of attention mechanisms in NLP?


a) To focus on relevant parts of the input sequence during model training
b) To reduce the dimensionality of the input data
c) To prevent overfitting of the model
d) To classify text into different categories
Answer: a) To focus on relevant parts of the input sequence during model
training

60. Which of the following is a common task in natural language processing?


a) Image classification
b) Speech recognition
c) Sentiment analysis
d) All of the above
Answer: c) Sentiment analysis

61. Which of the following is true about unsupervised learning?


a) It requires labeled data for training
b) It is used for classification tasks
c) It aims to find hidden patterns or structures in data
d) It cannot handle missing values in the dataset
Answer: c) It aims to find hidden patterns or structures in data

62. What is the purpose of dimensionality reduction techniques in machine learning?


a) To increase the number of features in the dataset
b) To reduce the computational complexity of the model
c) To visualize high-dimensional data
d) To create new features from existing ones
Answer: b) To reduce the computational complexity of the model
63. Which of the following is a common application of clustering algorithms?
a) Sentiment analysis
b) Image recognition
c) Customer segmentation
d) Regression analysis
Answer: c) Customer segmentation

64. What is the primary goal of ensemble learning?


a) To improve model interpretability
b) To reduce model complexity
c) To combine the predictions of multiple models to improve performance
d) To eliminate bias in the model
Answer: c) To combine the predictions of multiple models to improve performance

65. Which

of the following is true about the bias-variance tradeoff?


a) Increasing model complexity reduces bias and variance
b) Increasing model complexity increases bias and reduces variance
c) Increasing model complexity increases both bias and variance
d) Increasing model complexity does not affect bias or variance
Answer: c) Increasing model complexity increases both bias and variance

66. Which of the following is a common technique used for feature extraction in
image processing?
a) Principal Component Analysis (PCA)
b) Convolutional Neural Networks (CNNs)
c) Support Vector Machines (SVMs)
d) K-means clustering
Answer: b) Convolutional Neural Networks (CNNs)

67. What is the purpose of regularization techniques in machine learning?


a) To increase model complexity
b) To reduce overfitting of the model
c) To speed up the training process
d) To decrease the model's capacity
Answer: b) To reduce overfitting of the model

68. Which of the following is a common preprocessing step in image processing?


a) Tokenization
b) Normalization
c) One-Hot Encoding
d) Label Encoding
Answer: b) Normalization

69. Which of the following is true about transfer learning in machine learning?
a) It involves training a model from scratch for a new task
b) It does not require pre-trained models
c) It is not applicable to image recognition tasks
d) It leverages knowledge gained from training on one task to improve
performance on another task
Answer: d) It leverages knowledge gained from training on one task to improve
performance on another task

70. What is the primary goal of semi-supervised learning?


a) To train models using both labeled and unlabeled data
b) To train models using only labeled data
c) To train models using only unlabeled data
d) To train models using reinforcement learning techniques
Answer: a) To train models using both labeled and unlabeled data

71. Which of the following is a common technique used for handling imbalanced
datasets?
a) SMOTE (Synthetic Minority Over-sampling Technique)
b) Downsampling the majority class
c) Upsampling the minority class
d) All of the above
Answer: d) All of the above

72. Which of the following is true about feature selection techniques?


a) They always improve model performance
b) They can reduce the computational complexity of the model
c) They are only applicable to regression tasks
d) They increase the risk of overfitting
Answer: b) They can reduce the computational complexity of the model

73. What is the purpose of cross-entropy loss in classification tasks?


a) To measure the accuracy of the model
b) To compute the difference between predicted and actual values
c) To minimize the difference between predicted and actual distributions
d) To regularize the model
Answer: c) To minimize the difference between predicted and actual
distributions

74. Which of the following is a disadvantage of using linear regression?


a) It cannot handle non-linear relationships between variables
b) It is sensitive to outliers in the data
c) It is computationally expensive
d) It requires categorical variables as input
Answer: a) It cannot handle non-linear relationships between variables

75. What is the primary goal of data preprocessing in machine learning?


a) To increase the dimensionality of the data
b) To reduce the computational complexity of the model
c) To prepare the data for training by cleaning, transforming, and organizing
it
d) To generate new features from existing ones
Answer: c) To prepare the data for training by cleaning, transforming, and
organizing it

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy