1What type of value does linear regression usually predict?
Linear regression
Easy
A.A collection of clusters
B.A continuous numerical value
C.A set of decision rules
D.A sequence of labels
Correct Answer: A continuous numerical value
Explanation:
Linear regression predicts continuous numerical values, such as price, temperature, or salary.
Incorrect! Try again.
2What does a simple linear regression model fit to the data?
Linear regression
Easy
A.A branching tree
B.A circular boundary
C.A straight line
D.A group of centroids
Correct Answer: A straight line
Explanation:
Simple linear regression fits a straight line that describes the relationship between two variables.
Incorrect! Try again.
3In the equation , what does represent?
Linear regression
Easy
A.The predicted class
B.The clustering distance
C.The number of samples
D.The slope of the line
Correct Answer: The slope of the line
Explanation:
In , is the slope, which shows how much changes when increases by one unit.
Incorrect! Try again.
4Which measure is commonly minimized when fitting a linear regression model?
Linear regression
Easy
A.Number of clusters
B.Depth of the tree
C.Sum of squared errors
D.Count of neighbours
Correct Answer: Sum of squared errors
Explanation:
Linear regression commonly finds the line that minimizes the sum of squared differences between actual and predicted values.
Incorrect! Try again.
5What does the in K-nearest neighbours represent?
K-nearest neighbours
Easy
A.The number of clusters produced
B.The number of trees constructed
C.The number of nearby data points considered
D.The number of output variables predicted
Correct Answer: The number of nearby data points considered
Explanation:
specifies how many nearby training examples are used to make a prediction.
Incorrect! Try again.
6How does K-nearest neighbours commonly classify a new data point?
K-nearest neighbours
Easy
A.By fitting a regression line
B.By selecting a random class
C.By building several trees
D.By taking a neighbour vote
Correct Answer: By taking a neighbour vote
Explanation:
K-nearest neighbours commonly assigns the class that appears most often among the nearest training points.
Incorrect! Try again.
7Which calculation is commonly used to find nearest neighbours?
K-nearest neighbours
Easy
A.Regression slope
B.Euclidean distance
C.Cluster count
D.Tree depth
Correct Answer: Euclidean distance
Explanation:
Euclidean distance measures the straight-line distance between data points and is commonly used in K-nearest neighbours.
Incorrect! Try again.
8Why are features often scaled before applying K-nearest neighbours?
K-nearest neighbours
Easy
A.To remove every outlier
B.To create additional classes
C.To balance distance contributions
D.To increase the sample count
Correct Answer: To balance distance contributions
Explanation:
Scaling prevents features with larger numerical ranges from dominating the distance calculation.
Incorrect! Try again.
9What does an internal node in a decision tree usually represent?
Decision trees
Easy
A.A group of centroids
B.A fitted regression line
C.A final predicted value
D.A test on a feature
Correct Answer: A test on a feature
Explanation:
An internal node tests a feature and sends each example along a branch based on the result.
Incorrect! Try again.
10What does a leaf node in a classification tree usually provide?
Decision trees
Easy
A.A predicted class
B.A feature scaling rule
C.A distance measurement
D.A cluster centroid
Correct Answer: A predicted class
Explanation:
A leaf node represents the final output of the tree, such as a predicted class.
Incorrect! Try again.
11Which structure best describes a decision tree?
Decision trees
Easy
A.A hierarchy of branches
B.A collection of centroids
C.A table of distances
D.A single straight line
Correct Answer: A hierarchy of branches
Explanation:
A decision tree organizes tests and outcomes into a branching hierarchical structure.
Incorrect! Try again.
12What is pruning used for in a decision tree?
Decision trees
Easy
A.Adding more training rows
B.Creating additional features
C.Increasing every branch depth
D.Removing unnecessary branches
Correct Answer: Removing unnecessary branches
Explanation:
Pruning removes branches that add little value, making the tree simpler and reducing overfitting.
Incorrect! Try again.
13A random forest is mainly made up of multiple what?
Random forests
Easy
A.Distance matrices
B.Decision trees
C.Cluster centroids
D.Regression lines
Correct Answer: Decision trees
Explanation:
A random forest combines predictions from many decision trees.
Incorrect! Try again.
14How does a random forest commonly make a classification prediction?
Random forests
Easy
A.It uses the trees' majority vote
B.It averages all feature values
C.It selects the nearest centroid
D.It follows the deepest tree only
Correct Answer: It uses the trees' majority vote
Explanation:
For classification, the trees vote, and the class receiving the most votes is usually selected.
Incorrect! Try again.
15Why is randomness introduced when building a random forest?
Random forests
Easy
A.To eliminate all training data
B.To create varied decision trees
C.To produce a single cluster
D.To force identical tree structures
Correct Answer: To create varied decision trees
Explanation:
Random samples and feature subsets create varied trees whose combined predictions are more robust.
Incorrect! Try again.
16Compared with one deep decision tree, a random forest often helps reduce what?
Random forests
Easy
A.The range of labels
B.The number of features
C.The risk of overfitting
D.The need for predictions
Correct Answer: The risk of overfitting
Explanation:
Combining many varied trees generally reduces the overfitting associated with a single deep tree.
Incorrect! Try again.
17What type of machine learning algorithm is K-means?
K-means clustering
Easy
A.An unsupervised clustering algorithm
B.A supervised classification algorithm
C.A supervised regression algorithm
D.A rule-based sorting algorithm
Correct Answer: An unsupervised clustering algorithm
Explanation:
K-means groups unlabeled data into clusters, so it is an unsupervised learning algorithm.
Incorrect! Try again.
18What does represent in K-means clustering?
K-means clustering
Easy
A.The number of clusters
B.The number of labels
C.The number of trees
D.The number of features
Correct Answer: The number of clusters
Explanation:
In K-means, is the number of clusters the algorithm attempts to form.
Incorrect! Try again.
19What is a centroid in K-means clustering?
K-means clustering
Easy
A.The nearest labeled neighbour
B.The deepest branch of a tree
C.The slope of a fitted line
D.The center of a cluster
Correct Answer: The center of a cluster
Explanation:
A centroid is the representative center, usually the mean position, of the points in a cluster.
Incorrect! Try again.
20How is a data point commonly assigned to a cluster in K-means?
K-means clustering
Easy
A.By choosing a random tree
B.By following a class label
C.By finding the nearest centroid
D.By selecting the largest cluster
Correct Answer: By finding the nearest centroid
Explanation:
K-means assigns each data point to the cluster whose centroid is nearest.
Incorrect! Try again.
21A fitted linear regression model is . What prediction does it make when ?
Linear regression
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
Substituting gives .
Incorrect! Try again.
22A linear regression model is trained by minimizing mean squared error. What is the most likely effect of adding one extreme response-value outlier?
Linear regression
Medium
A.It may strongly shift the fitted line
B.It removes the need for an intercept
C.It guarantees a horizontal fitted line
D.It converts the model into a classifier
Correct Answer: It may strongly shift the fitted line
Explanation:
Squared errors give large residuals substantial influence, so an extreme outlier can noticeably shift the fitted line.
Incorrect! Try again.
23The relationship between two variables is . If the feature is transformed to , which equation expresses in terms of ?
Linear regression
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
Because , substitution gives .
Incorrect! Try again.
24A developer standardizes features before fitting linear regression and then evaluates the model on a test set. Which procedure best prevents data leakage?
Linear regression
Medium
A.Fit the scaler on all data before splitting
B.Fit the scaler on training data only
C.Fit separate models before standardizing
D.Fit the scaler on test data only
Correct Answer: Fit the scaler on training data only
Explanation:
The scaler must learn its statistics only from training data and then apply those statistics to both sets.
Incorrect! Try again.
25Using Euclidean distance, which training point is nearest to the query point ?
K-nearest neighbours
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
Its distance is , which is smaller than the other distances.
Incorrect! Try again.
26A K-nearest neighbours classifier overfits noisy training data when . What is the most appropriate adjustment?
K-nearest neighbours
Medium
A.Remove all distance calculations
B.Decrease to sharpen the boundary
C.Increase to smooth the boundary
D.Replace labels with feature means
Correct Answer: Increase to smooth the boundary
Explanation:
A larger bases predictions on more neighbours, reducing sensitivity to individual noisy samples.
Incorrect! Try again.
27For a query sample, the five nearest neighbours have class labels A, B, A, B, and A. With uniform voting, what class is predicted?
K-nearest neighbours
Medium
A.Class B
B.Class A
C.Both classes
D.Neither class
Correct Answer: Class A
Explanation:
Class A receives three votes, while class B receives two.
Incorrect! Try again.
28A K-nearest neighbours model uses age values from 18 to 70 and annual income values from 20,000 to 200,000. Why should these features usually be scaled?
K-nearest neighbours
Medium
A.To guarantee perfectly balanced classes
B.To prevent income from dominating distance
C.To eliminate the choice of
D.To make every neighbour equally distant
Correct Answer: To prevent income from dominating distance
Explanation:
Without scaling, the much larger numerical range of income can dominate distance calculations.
Incorrect! Try again.
29A node contains six samples from class A and four from class B. What is its Gini impurity?
Decision trees
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
The impurity is .
Incorrect! Try again.
30A decision tree achieves 100% training accuracy but much lower validation accuracy. Which change is most likely to improve generalization?
Decision trees
Medium
A.Reduce the maximum tree depth
B.Duplicate every training example
C.Increase the maximum tree depth
D.Remove the validation examples
Correct Answer: Reduce the maximum tree depth
Explanation:
Limiting depth reduces model complexity and can prevent the tree from fitting training noise.
Incorrect! Try again.
31A decision-tree node tests whether temperature <= 20. A sample has temperature = 20. Which branch does it follow?
Decision trees
Medium
A.Both branches with equal weight
B.The branch where the condition is true
C.Neither branch until retraining
D.The branch where the condition is false
Correct Answer: The branch where the condition is true
Explanation:
The value 20 satisfies the less-than-or-equal-to condition.
Incorrect! Try again.
32What is the likely effect of increasing min_samples_leaf when training a decision tree?
Decision trees
Medium
A.It forces every leaf to be pure
B.It changes classification into clustering
C.It creates fewer, larger leaf nodes
D.It creates more, smaller leaf nodes
Correct Answer: It creates fewer, larger leaf nodes
Explanation:
A larger minimum leaf size prevents splits that would create small leaves, usually simplifying the tree.
Incorrect! Try again.
33Which training strategy is central to a random forest?
Random forests
Medium
A.Train linear models on sequential residuals
B.Train one tree repeatedly on identical data
C.Train trees on bootstrap samples and feature subsets
D.Train clusters using randomly selected centroids
Correct Answer: Train trees on bootstrap samples and feature subsets
Explanation:
Random forests combine bootstrap sampling with random feature selection to produce diverse decision trees.
Incorrect! Try again.
34How does a random forest typically produce a final classification prediction?
Random forests
Medium
A.It uses the majority vote of its trees
B.It averages all original feature values
C.It chooses the label of one random tree
D.It selects the prediction of the deepest tree
Correct Answer: It uses the majority vote of its trees
Explanation:
For classification, individual tree predictions are commonly combined using majority voting.
Incorrect! Try again.
35What are out-of-bag samples for a particular tree in a random forest?
Random forests
Medium
A.Samples misclassified by every tree in the forest
B.Samples removed because they contain missing values
C.Samples omitted from that tree's bootstrap set
D.Samples created by averaging nearby observations
Correct Answer: Samples omitted from that tree's bootstrap set
Explanation:
Bootstrap sampling leaves out some training examples, which can be used to estimate performance for that tree.
Incorrect! Try again.
36Why does averaging many relatively uncorrelated decision trees often improve predictions?
Random forests
Medium
A.It reduces variance while retaining flexible patterns
B.It converts categorical features into numbers
C.It guarantees zero error on unseen data
D.It removes every source of prediction bias
Correct Answer: It reduces variance while retaining flexible patterns
Explanation:
Averaging diverse trees makes the ensemble less sensitive to fluctuations in the training data.
Incorrect! Try again.
37Two K-means centroids are and . Using Euclidean distance, to which centroid is the point assigned?
K-means clustering
Medium
A.
B.Neither centroid
C.Both centroids
D.
Correct Answer:
Explanation:
The distance to is , while the distance to is .
Incorrect! Try again.
38A K-means cluster contains the points , , and . What centroid is computed during the update step?
K-means clustering
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
The centroid is the coordinate-wise mean: .
Incorrect! Try again.
39Which quantity does standard K-means attempt to minimize?
K-means clustering
Medium
A.Classification error against known labels
B.Between-cluster sum of squared distances
C.Number of features in each cluster
D.Within-cluster sum of squared distances
Correct Answer: Within-cluster sum of squared distances
Explanation:
K-means minimizes the squared distance from each point to the centroid of its assigned cluster.
Incorrect! Try again.
40A dataset has one feature measured from 0 to 1 and another from 0 to 100,000. What should usually be done before applying K-means?
K-means clustering
Medium
A.Sort all rows by the larger feature
B.Convert every feature into a class label
C.Set each initial centroid to zero
D.Scale the features to comparable ranges
Correct Answer: Scale the features to comparable ranges
Explanation:
Scaling prevents the feature with the larger numerical range from dominating Euclidean distances.
Incorrect! Try again.
41A simple linear regression with an intercept gives , , and slope . Define and . If is regressed on with an intercept, what are the new intercept and slope?
Linear regression
Hard
A.Intercept and slope
B.Intercept and slope
C.Intercept and slope
D.Intercept and slope
Correct Answer: Intercept and slope
Explanation:
The original line is . Since and , the transformed line is .
Incorrect! Try again.
42The true population model is , where , , and is uncorrelated with both predictors. What is the population slope when is regressed only on ?
Linear regression
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
The omitted-variable formula gives .
Incorrect! Try again.
43In an ordinary least-squares model, observation has , fitted value , and leverage . Without refitting the model directly, what is its leave-one-out predicted value ?
Linear regression
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
The leave-one-out residual is . Therefore, .
Incorrect! Try again.
44A regression with an intercept contains predictors satisfying exactly. If the uniquely estimable fitted linear effect is , which condition characterizes every coefficient pair producing those fitted values?
Linear regression
Hard
A.
B. and must hold because ordinary least squares always selects the first collinear predictor
C.
D.
Correct Answer:
Explanation:
The predictor contribution is . Collinearity makes the individual coefficients nonunique.
Incorrect! Try again.
45A 1-NN classifier uses Euclidean distance. For query , the two training points are of class A and of class B. What happens if the second feature is multiplied by for both training and query data?
K-nearest neighbours
Hard
A.The prediction remains class A
B.The prediction remains class B
C.The prediction changes from B to A
D.The prediction changes from A to B
Correct Answer: The prediction changes from B to A
Explanation:
Originally, the distances are to A and to B. After scaling, they are to A and to B.
Incorrect! Try again.
46A distance-weighted 4-NN classifier assigns each neighbour weight . The neighbours have labels and distances A at , A at , B at , and B at . Which class is predicted?
K-nearest neighbours
Hard
A.Class A, with total weight
B.Class B, with total weight
C.Neither class, because each has two neighbours
D.Class B, because its two neighbours have a smaller arithmetic mean distance and weighted KNN always uses only that mean
Correct Answer: Class A, with total weight
Explanation:
Class A receives , while class B receives .
Incorrect! Try again.
47Two points are independently sampled from the uniform distribution on . As increases, what happens to the coefficient of variation of their squared Euclidean distance?
K-nearest neighbours
Hard
A.It decreases proportionally to
B.It increases proportionally to
C.It remains exactly unchanged for every dimension
D.It converges to a positive constant
Correct Answer: It decreases proportionally to
Explanation:
The squared distance is a sum of independent terms. Its mean grows as and its standard deviation as , so their ratio scales as .
Incorrect! Try again.
48An inverse-distance KNN classifier encounters three training samples exactly at the query: two have class B and one has class A. Other nonzero-distance neighbours have class A. Under the standard zero-distance safeguard, what should it predict?
K-nearest neighbours
Hard
A.Class B using only zero-distance samples
B.Class A using all selected neighbours
C.Class A using the nearest nonzero sample
D.No class, because inverse-distance weighting cannot be made well-defined when any training distance equals zero
Correct Answer: Class B using only zero-distance samples
Explanation:
A common safeguard restricts voting to samples at zero distance whenever they exist. Their majority class is B, and finite-distance samples are ignored.
Incorrect! Try again.
49A binary-class node contains 6 positive and 4 negative samples. A candidate split creates a pure left child containing 4 positives and a right child containing 2 positives and 4 negatives. What is the Gini impurity decrease?
Decision trees
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
The parent impurity is . The weighted child impurity is , giving .
Incorrect! Try again.
50A balanced dataset has two independent binary features and target , with every input combination equally represented. A tree algorithm refuses splits having zero immediate information gain. What model does it learn at the root?
Decision trees
Hard
A.A stump, despite a perfect depth-2 tree existing
B.A perfect tree after splitting on either feature
C.A depth-1 tree with one pure child
D.A depth-2 tree because the algorithm evaluates all pairs of consecutive splits before applying its stopping criterion
Correct Answer: A stump, despite a perfect depth-2 tree existing
Explanation:
Each feature alone leaves both children class-balanced, so its immediate gain is zero. A greedy rule rejecting zero-gain splits cannot reach the perfect second-level splits.
Incorrect! Try again.
51Three candidate subtrees have training misclassification rates and leaf counts , , and . Which subtree minimizes the cost-complexity objective when ?
Decision trees
Hard
A.All three subtrees have the same penalized objective
B.The subtree with rate and 2 leaves
C.The subtree with rate and 4 leaves
D.The subtree with rate and 8 leaves
Correct Answer: The subtree with rate and 4 leaves
Explanation:
The three objectives are , , and , respectively. Thus, the four-leaf subtree has the lowest penalized error.
Incorrect! Try again.
52A continuous feature is replaced by a strictly increasing transformation of itself before training an exact greedy decision tree. Assuming no missing values and deterministic tie handling, what is preserved?
Decision trees
Hard
A.The numerical threshold values at every node
B.The impurity value of each individual sample
C.The distances between samples and therefore every split margin
D.The candidate partitions and resulting predictions
Correct Answer: The candidate partitions and resulting predictions
Explanation:
A strictly increasing transformation preserves feature ordering, so threshold splits induce the same sample partitions. The numerical thresholds themselves generally change.
Incorrect! Try again.
53Each tree in a random forest draws training observations with replacement from a dataset of size . As , what fraction of observations is expected to be out-of-bag for a particular tree?
Random forests
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
An observation is excluded with probability , which converges to .
Incorrect! Try again.
54Individual trees have prediction variance , and every pair of trees has prediction correlation . Assuming equal variance and covariance, what is the variance of the average prediction from 100 trees?
Random forests
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
The ensemble variance is .
Incorrect! Try again.
55A dataset contains one very strong predictor and many weak predictors. What is the likely effect of setting max_features equal to the total number of predictors at every split?
Random forests
Hard
A.Trees become more correlated, reducing aggregation's variance benefit
B.Trees become less correlated, improving aggregation's variance benefit
C.Every tree becomes identical because bootstrap sampling no longer occurs when all predictors are considered at each split
D.Bootstrap samples become larger and include more unique observations
Correct Answer: Trees become more correlated, reducing aggregation's variance benefit
Explanation:
The strong predictor is repeatedly selected across trees. This increases tree correlation, weakening the variance reduction obtained by averaging.
Incorrect! Try again.
56Which statement best compares impurity-based feature importance with held-out permutation importance in a random forest?
Random forests
Hard
A.Impurity importance favors high-cardinality features; permutation importance can be masked by correlated predictors
B.Both measures are unbiased whenever the forest contains sufficiently many trees
C.Impurity importance measures causal effects, whereas permutation importance measures coefficients from an implicit linear model
D.Permutation importance favors high-cardinality features; impurity importance is unaffected by predictor correlation
Correct Answer: Impurity importance favors high-cardinality features; permutation importance can be masked by correlated predictors
Explanation:
Features offering many split points can receive inflated impurity importance. Correlated predictors may substitute for one another, reducing each one's measured permutation effect.
Incorrect! Try again.
57A K-means cluster contains the points , , and . After updating its centroid optimally, what is this cluster's within-cluster sum of squared errors?
K-means clustering
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
The centroid is . The squared distances are , , and , whose sum is .
Incorrect! Try again.
58For the one-dimensional points , what is the minimum possible K-means objective when ?
K-means clustering
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
The optimal clusters are and . Their centroids are and , producing total squared error .
Incorrect! Try again.
59A feature in a K-means dataset is multiplied by without changing other features. How does that feature's contribution to every squared Euclidean distance change?
K-means clustering
Hard
A.It remains unchanged because K-means automatically standardizes every feature before computing cluster assignments
B.It is divided by
C.It is multiplied by
D.It is multiplied by
Correct Answer: It is multiplied by
Explanation:
K-means uses squared differences. Replacing a difference by changes its contribution from to .
Incorrect! Try again.
60During K-means++ initialization in one dimension, the first center is at . The remaining candidate observations are at , , and , each occurring once. What is the probability that is selected as the next center?
K-means clustering
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
K-means++ samples in proportion to squared distance from the nearest center. The weights are , , and , so the probability is .
Incorrect! Try again.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill.
The rest comes out of a student's own pocket: the domain, the storage,
and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it.
What it pays for →