1What type of value does linear regression usually predict?
Linear regression
Easy
A.A sequence of labels
B.A collection of clusters
C.A set of decision rules
D.A continuous numerical value
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 group of centroids
B.A straight line
C.A branching tree
D.A circular boundary
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 clustering distance
B.The number of samples
C.The predicted class
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.Count of neighbours
B.Depth of the tree
C.Number of clusters
D.Sum of squared errors
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 output variables predicted
B.The number of trees constructed
C.The number of nearby data points considered
D.The number of clusters produced
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 selecting a random class
B.By taking a neighbour vote
C.By fitting a regression line
D.By building several trees
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.Tree depth
B.Euclidean distance
C.Regression slope
D.Cluster count
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 balance distance contributions
C.To create additional classes
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 final predicted value
B.A fitted regression line
C.A group of centroids
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 cluster centroid
C.A feature scaling rule
D.A distance measurement
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 table of distances
B.A hierarchy of branches
C.A collection of centroids
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.Creating additional features
B.Removing unnecessary branches
C.Adding more training rows
D.Increasing every branch depth
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.Decision trees
B.Regression lines
C.Cluster centroids
D.Distance matrices
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 follows the deepest tree only
B.It uses the trees' majority vote
C.It selects the nearest centroid
D.It averages all feature values
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 create varied decision trees
B.To force identical tree structures
C.To eliminate all training data
D.To produce a single cluster
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 risk of overfitting
B.The number of features
C.The need for predictions
D.The range of labels
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 features
C.The number of labels
D.The number of trees
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 slope of a fitted line
B.The nearest labeled neighbour
C.The center of a cluster
D.The deepest branch of a tree
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 finding the nearest centroid
C.By selecting the largest cluster
D.By following a class label
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 converts the model into a classifier
C.It guarantees a horizontal fitted line
D.It removes the need for an intercept
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 training data only
B.Fit the scaler on all data before splitting
C.Fit the scaler on test data only
D.Fit separate models before standardizing
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.Replace labels with feature means
B.Remove all distance calculations
C.Decrease to sharpen the boundary
D.Increase to smooth the boundary
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.Both classes
C.Neither class
D.Class A
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 eliminate the choice of
C.To make every neighbour equally distant
D.To prevent income from dominating distance
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.Increase the maximum tree depth
B.Remove the validation examples
C.Duplicate every training example
D.Reduce the maximum tree depth
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.The branch where the condition is true
B.Neither branch until retraining
C.Both branches with equal weight
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 changes classification into clustering
B.It creates fewer, larger leaf nodes
C.It creates more, smaller leaf nodes
D.It forces every leaf to be pure
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 clusters using randomly selected centroids
B.Train one tree repeatedly on identical data
C.Train trees on bootstrap samples and feature subsets
D.Train linear models on sequential residuals
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 selects the prediction of the deepest tree
C.It chooses the label of one random tree
D.It averages all original feature values
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 removes every source of prediction bias
C.It converts categorical features into numbers
D.It guarantees zero error on unseen data
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.Both centroids
C.Neither centroid
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.Number of features in each cluster
B.Between-cluster sum of squared distances
C.Classification error against known labels
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.Set each initial centroid to zero
C.Convert every feature into a class label
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 B
B.The prediction changes from B to A
C.The prediction remains class 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 B, with total weight
B.Neither class, because each has two neighbours
C.Class B, because its two neighbours have a smaller arithmetic mean distance and weighted KNN always uses only that mean
D.Class A, with total weight
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 remains exactly unchanged for every dimension
B.It increases proportionally to
C.It decreases proportionally to
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.No class, because inverse-distance weighting cannot be made well-defined when any training distance equals zero
B.Class B using only zero-distance samples
C.Class A using all selected neighbours
D.Class A using the nearest nonzero sample
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 perfect tree after splitting on either feature
B.A depth-1 tree with one pure child
C.A stump, despite a perfect depth-2 tree existing
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.The subtree with rate and 2 leaves
B.All three subtrees have the same penalized objective
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 distances between samples and therefore every split margin
B.The numerical threshold values at every node
C.The candidate partitions and resulting predictions
D.The impurity value of each individual sample
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.Every tree becomes identical because bootstrap sampling no longer occurs when all predictors are considered at each split
B.Trees become less correlated, improving aggregation's variance benefit
C.Trees become more correlated, reducing aggregation's variance benefit
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.Both measures are unbiased whenever the forest contains sufficiently many trees
B.Impurity importance favors high-cardinality features; permutation importance can be masked by correlated predictors
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 is divided by
B.It remains unchanged because K-means automatically standardizes every feature before computing cluster assignments
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 →