MCQs / Computer Science / NSCT: AI, Machine Learning & Data Analytics

NSCT: AI, Machine Learning & Data Analytics MCQs — Computer Science (page 2)

127 multiple-choice questions on NSCT: AI, Machine Learning & Data Analytics from Computer Science, each with the correct answer and, where available, a teacher's explanation. Read through them to revise the chapter, then practise the same questions one by one to test yourself.

26. The F1-score is the:

  1. Ratio of FP to FN
  2. Product of TP and TN
  3. Harmonic mean of precision and recall
  4. Average of accuracy and recall

Answer: C) Harmonic mean of precision and recall

Explanation: Useful for imbalanced data. Lesson 8.3 · AI, Machine Learning & Data Analytics

Discuss this question

27. Randomly switching off neurons during training to reduce overfitting is:

  1. Padding
  2. Stemming
  3. Pooling
  4. Dropout

Answer: D) Dropout

Explanation: It forces the network to be robust. Lesson 8.5 · AI, Machine Learning & Data Analytics

Discuss this question

28. A dataset of 1200 samples is used in 4-fold cross-validation. How many samples are in each test fold?

  1. 900
  2. 4
  3. 240
  4. 300

Answer: D) 300

Explanation: 1200 ÷ 4 = 300; the other 900 are used for training in that round. Lesson 8.3 · AI, Machine Learning & Data Analytics

Discuss this question

29. Converting a "City" column (Lahore, Karachi, Quetta) into separate 0/1 columns is:

  1. Standardization
  2. One-hot encoding
  3. Tokenization
  4. Label smoothing

Answer: B) One-hot encoding

Explanation: Suitable for nominal categories. Lesson 8.2 · AI, Machine Learning & Data Analytics

Discuss this question

30. Which Python library is most used for classic ML algorithms like random forest and k-means?

  1. Tkinter
  2. BeautifulSoup
  3. scikit-learn
  4. Django

Answer: C) scikit-learn

Explanation: It offers a consistent fit/predict API. Lesson 8.1 · AI, Machine Learning & Data Analytics

Discuss this question

31. Classifying emails as spam or not spam is:

  1. Unsupervised clustering
  2. Supervised classification
  3. Regression
  4. Dimensionality reduction

Answer: B) Supervised classification

Explanation: Labels (spam / not spam) are known. Lesson 8.3 · AI, Machine Learning & Data Analytics

Discuss this question

32. PCA reduces 50 features to 2 principal components. How many features does each sample have after PCA?

  1. 48
  2. 2
  3. 25
  4. 50

Answer: B) 2

Explanation: Each sample is projected onto the chosen components. Lesson 8.2 · AI, Machine Learning & Data Analytics

Discuss this question

33. The activation function commonly used in hidden layers of deep networks is:

  1. Linear only
  2. Softmax
  3. Step only
  4. ReLU

Answer: D) ReLU

Explanation: ReLU(x) = max(0, x). Lesson 8.5 · AI, Machine Learning & Data Analytics

Discuss this question

34. The elbow method is used to:

  1. Remove outliers
  2. Split train and test data
  3. Encode text
  4. Choose the number of clusters in k-means

Answer: D) Choose the number of clusters in k-means

Explanation: Look for the bend in the within-cluster error curve. Lesson 8.4 · AI, Machine Learning & Data Analytics

Discuss this question

35. Rescaling a feature to the range 0 to 1 is called:

  1. One-hot encoding
  2. Min-max normalization
  3. Imputation
  4. Standardization

Answer: B) Min-max normalization

Explanation: x' = (x − min) ÷ (max − min). Lesson 8.2 · AI, Machine Learning & Data Analytics

Discuss this question

36. A classifier's confusion matrix is: TP = 8, FP = 2, FN = 12, TN = 978. What is its F1-score (to 2 decimal places)?

  1. 0.60
  2. 0.53
  3. 0.32
  4. 0.99

Answer: B) 0.53

Explanation: F1 = 2PR ÷ (P + R) = 2 × 0.80 × 0.40 ÷ (0.80 + 0.40) = 0.53. Lesson 8.3 · AI, Machine Learning & Data Analytics

Discuss this question

37. Predicting the price of a house from its features is a:

  1. Classification problem
  2. Clustering problem
  3. Reinforcement problem
  4. Regression problem

Answer: D) Regression problem

Explanation: The output is a continuous number. Lesson 8.3 · AI, Machine Learning & Data Analytics

Discuss this question

38. PCA is mainly used for:

  1. Data encryption
  2. Classification
  3. Imputing labels
  4. Dimensionality reduction

Answer: D) Dimensionality reduction

Explanation: It finds new axes that capture most variance. Lesson 8.2 · AI, Machine Learning & Data Analytics

Discuss this question

39. Grouping customers by purchasing behaviour without predefined labels is:

  1. Reinforcement learning
  2. Regression
  3. Clustering
  4. Classification

Answer: C) Clustering

Explanation: An unsupervised task. Lesson 8.4 · AI, Machine Learning & Data Analytics

Discuss this question

40. Actual values [10, 12, 8] and predictions [11, 10, 8]. What is the Mean Squared Error (MSE)?

  1. 5
  2. 1.29
  3. 1
  4. 1.67

Answer: D) 1.67

Explanation: Mean of squared errors = 1.67. Lesson 8.3 · AI, Machine Learning & Data Analytics

Discuss this question

41. Settings chosen before training, like k in k-NN or maximum tree depth, are:

  1. Features
  2. Hyperparameters
  3. Labels
  4. Weights

Answer: B) Hyperparameters

Explanation: Model parameters are learned; hyperparameters are set. Lesson 8.3 · AI, Machine Learning & Data Analytics

Discuss this question

42. Despite its name, logistic regression is used for:

  1. Dimensionality reduction
  2. Regression only
  3. Clustering
  4. Classification

Answer: D) Classification

Explanation: It outputs a probability via the sigmoid function. Lesson 8.3 · AI, Machine Learning & Data Analytics

Discuss this question

43. Which clustering algorithm can find arbitrarily shaped clusters and label outliers as noise?

  1. Linear regression
  2. k-means
  3. DBSCAN
  4. Naive Bayes

Answer: C) DBSCAN

Explanation: It is density-based. Lesson 8.4 · AI, Machine Learning & Data Analytics

Discuss this question

44. In the PEAS description of an intelligent agent, "S" stands for:

  1. Software
  2. Search
  3. Sensors
  4. Speed

Answer: C) Sensors

Explanation: Performance, Environment, Actuators, Sensors. Lesson 8.1 · AI, Machine Learning & Data Analytics

Discuss this question

45. A classifier's confusion matrix is: TP = 8, FP = 2, FN = 12, TN = 978. What is its recall?

  1. 98.6%
  2. 40%
  3. 60%
  4. 80%

Answer: B) 40%

Explanation: Recall = TP ÷ (TP + FN) = 8 ÷ 20 = 40%. Lesson 8.3 · AI, Machine Learning & Data Analytics

Discuss this question

46. Splitting text into words or sub-words is called:

  1. Tokenization
  2. Normalization
  3. Stop-word removal
  4. Lemmatization

Answer: A) Tokenization

Explanation: The first step of most NLP pipelines. Lesson 8.5 · AI, Machine Learning & Data Analytics

Discuss this question

47. Which of the 5 Vs of big data refers to the speed at which data is generated?

  1. Volume
  2. Variety
  3. Velocity
  4. Veracity

Answer: C) Velocity

Explanation: e.g. streaming sensor data. Lesson 8.5 · AI, Machine Learning & Data Analytics

Discuss this question

48. A feature ranges from 10 to 60. What is the min-max normalized value of 30?

  1. 0.5
  2. 0.65
  3. 0.6
  4. 0.4

Answer: D) 0.4

Explanation: (x − min) ÷ (max − min) = (30 − 10) ÷ (60 − 10) = 0.4. Lesson 8.2 · AI, Machine Learning & Data Analytics

Discuss this question

49. Exploratory Data Analysis (EDA) is done mainly to:

  1. Deploy the model
  2. Write the final report only
  3. Encrypt the data
  4. Understand the data's patterns, distributions and problems before modelling

Answer: D) Understand the data's patterns, distributions and problems before modelling

Explanation: EDA guides cleaning and model choice. Lesson 8.2 · AI, Machine Learning & Data Analytics

Discuss this question

50. "Satisfaction: low, medium, high" is which type of data?

  1. Nominal categorical
  2. Continuous numeric
  3. Ordinal categorical
  4. Unstructured

Answer: C) Ordinal categorical

Explanation: The categories have a natural order. Lesson 8.2 · AI, Machine Learning & Data Analytics

Discuss this question

Previous Page 2 of 6 Next

Practise NSCT: AI, Machine Learning & Data Analytics MCQs

More Computer Science chapters