wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Page 1

Total questions: 125

Worksheet time: 1hrs 3mins

Name
Class
Date
1.

In ML, which of the following best defines a “hypothesis”?

a)

A ground truth

b)

A learned mapping

c)

Input features

d)

Label distribution

2.

What is the best k value to start with in practice for a balanced dataset?

a)

n\sqrt{n}

b)

log(n)\log(n)

c)

n2\frac{n}{2}

d)

Fixed at 5

3.

df = pd.DataFrame({'a':[1,2], 'b':[3,4]}); df['c']=df['a']+df['b']; What is df['c'][0]?

a)

3

b)

4

c)

5

d)

6

4.

Mistake Bound Model is used to:

a)

Measure error

b)

Count support vectors

c)

Bound incorrect outputs

d)

Predict probabilities

5.

A feature divides a dataset into subsets with entropies 0.4 and 0.6. If the subsets have equal size, what is the information gain?

a)

0.5

b)

0.6

c)

0.4

d)

1

6.

Which optimizer adapts learning rate per parameter?

a)

Adam

b)

SGD

c)

Momentum

d)

Adagrad

7.

What is the hypothesis space?

a)

Set of outputs

b)

Set of all features

c)

Set of possible functions

d)

Set of input samples

8.

A case base adds 25 new cases per month. How many new cases are added in 5 months?

a)

50

b)

100

c)

125

d)

150

9.

Infinite hypothesis space implies:

a)

Fixed solutions

b)

Random guessing

c)

Larger model capacity

d)

Poor accuracy

10.

Gibbs algorithm chooses h with posterior = 0.4. What is chance of incorrect prediction if its error is 0.2?

a)

0.2

b)

0.6

c)

0.4

d)

0.8

11.

What is the typical loss function in backpropagation?

a)

Precision

b)

Cross-entropy

c)

Mutation loss

d)

Gradient ratio

12.

Which of the following is NOT a component of a learning problem?

a)

Hypothesis space

b)

Target function

c)

Output label

d)

Hyperparameter tuning

13.

A learning problem with multiple possible outputs is referred to as:

a)

Regression

b)

Clustering

c)

Classification

d)

Multi-class classification

14.

Which function gives the first 5 rows of a DataFrame?

a)

df.head()

b)

df.tail()

c)

df.sample()

d)

df.describe()

15.

What is the goal of the EM algorithm?

a)

Maximize likelihood

b)

Minimize bias

c)

Compute gradient

d)

Reduce variance

16.

Given weights [0.2, 0.3] and input [1, 1], bias = -0.6. Will perceptron fire?

a)

Yes

b)

No

c)

Can’t say

d)

Maybe

17.

What is the basic unit of a neural network?

a)

Neuron

b)

Pixel

c)

Weight

d)

Classifier

18.

Why do deeper neural networks require more data?

a)

Faster convergence

b)

Higher parameters

c)

Prevent overfitting

d)

Better scaling

19.

A dataset with 100 samples is split into two sets: 40 and 60 samples, with entropies 0.8 and 0.5 respectively. Find weighted average entropy.

a)

0.62

b)

0.64

c)

0.68

d)

0.7

20.

Case-based learning is similar to:

a)

Genetic programming

b)

Memory-based reasoning

c)

Clustering

d)

Neural Networks

21.

What does inductive bias help with in machine learning?

a)

Increase data size

b)

Improve accuracy

c)

Guide hypothesis selection

d)

Add noise to data

22.

What type of join keeps only common rows between two DataFrames?

a)

Inner

b)

Outer

c)

Left

d)

Right

23.

What does np.std(np.array([1,2,3,4])) compute?

a)

Standard deviation

b)

Variance

c)

Mean

d)

Mode

24.

Which parameter in concat() can ignore duplicate indices?

a)

ignore_index=True

b)

drop_index=True

c)

axis=1

d)

index=False

25.

If hypothesis space H has 1,000 hypotheses, I^μ=0.05Îμ=0.05 , I^=0.05Î^=0.05 , compute required sample size using PAC bound: (1/I^μ)(lnH+ln(1/I^)(1/Îμ) * (ln|H| + ln(1/Î^) .

a)

373

b)

460

c)

420

d)

380

26.

What is np.percentile([1,2,3,4,5], 50)?

a)

3

b)

2.5

c)

4

d)

5

27.

In a belief network, what do edges represent?

a)

Feature weights

b)

Dependencies

c)

Bias terms

d)

Layers

28.

Which learning scenario best applies to concept learning?

a)

Supervised

b)

Unsupervised

c)

Reinforcement

d)

Self-supervised

29.

You want to append data to a CSV file. What mode do you use in open()?

a)

'a'

b)

'w'

c)

'x'

d)

'r'

30.

If two points are equidistant from a test point, how are their weights treated in Gaussian kernel LWR?

a)

Differently

b)

Equally

c)

Zero

d)

Inversely

31.

What will df.set_index('id') do?

a)

Set 'id' column as index

b)

Drop index

c)

Remove 'id'

d)

Create multi-index

32.

A model consistently prefers linear boundaries even for non-linear problems. What is the result of this bias?

a)

Faster learning

b)

Underfitting

c)

Overfitting

d)

Perfect generalization

33.

Which distance metric is commonly used in KNN?

a)

Manhattan

b)

Hamming

c)

Euclidean

d)

Cosine

34.

Genetic programming differs from GA in:

a)

No selection

b)

Representation type

c)

Uses weights

d)

No fitness function

35.

What causes overfitting in decision trees?

a)

Too few nodes

b)

Too few samples

c)

Too many branches

d)

Low variance

36.

The output layer of an RBF network is usually:

a)

Sigmoid

b)

Decision tree

c)

Linear

d)

Tanh

37.

The Find-S algorithm always converges to:

a)

Most general hypothesis

b)

A random hypothesis

c)

Most specific consistent hypothesis

d)

All consistent hypotheses

38.

What is the result of np.sqrt(np.array([4, 9, 16]))?

a)

[2. 3. 4.]

b)

[4 9 16]

c)

[1.4, 3.0, 4.0]

d)

[2,3,5]

39.

In 2D space, an RBF neuron with center (2, 2) and input (4, 5) gives Euclidean distance of:

a)

3

b)

13\sqrt{13}

c)

17\sqrt{17}

d)

5

40.

What is vanishing gradient problem commonly associated with?

a)

Sigmoid activation

b)

ReLU activation

c)

Large batch size

d)

Weight initialization

41.

Which step in EM is responsible for assigning probabilities to latent variables?

a)

E-step

b)

M-step

c)

Initialization

d)

Inference

42.

In concept learning, examples are typically labeled as:

a)

Numerical

b)

Categorical

c)

Positive/Negative

d)

Null values

43.

Which method returns the standard deviation of a NumPy array?

a)

array.std()

b)

array.mean()

c)

np.sqrt()

d)

array.sum()

44.

Which method can reset DataFrame index?

a)

reset_index()

b)

reindex()

c)

drop_index()

d)

set_index()

45.

What does the Candidate Elimination algorithm eliminate?

a)

Incorrect data

b)

Inconsistent hypotheses

c)

Labels

d)

Bias

46.

If Gain(S, A) = 0.1 and Gain(S, B) = 0.3, which feature is chosen for the root of the decision tree?

a)

A

b)

B

c)

None

d)

Both equally

47.

During retrieval, which of the following is used?

a)

Weight matrix

b)

Euclidean similarity

c)

Similarity measure

d)

Decision rules

48.

In a noisy learning scenario, 20% of 1000 samples are mislabeled. How many are correctly labelled?

a)

800

b)

200

c)

700

d)

900

49.

What assumption is made in a Naïve Bayes classifier?

a)

Features are correlated

b)

Features are independent

c)

Classes are balanced

d)

Features are binary

50.

In high-dimensional data, which distance metric is most sensitive to dimensionality?

a)

Cosine

b)

Manhattan

c)

Euclidean

d)

Hamming

51.

A chromosome has fitness 8, total fitness of population is 40. What is selection probability in roulette wheel?

a)

0.2

b)

0.4

c)

0.8

d)

0.1

52.

Genetic algorithm is most suitable for:

a)

Continuous optimization

b)

Discrete search

c)

Symbolic logic

d)

Deterministic problems

53.

A model has 4 hypotheses. It misclassifies 1 out of 10 training samples. What is the training error rate?

a)

0.1

b)

0.4

c)

0.01

d)

0.25

54.

Which option in to_csv() controls column separator?

a)

sep=','

b)

delimiter=','

c)

format=','

d)

split=','

55.

Given df['a'] = [1,2,3], what does df['a'] > 1 return?

a)

Boolean Series

b)

List

c)

DataFrame

d)

Error

56.

When does Gibbs equal Bayes Optimal?

a)

When one hypothesis dominates

b)

Always

c)

Never

d)

If H is infinite

57.

How many weights are needed between input (5 nodes) and hidden layer (3 neurons) with bias for each hidden node?

a)

15

b)

18

c)

20

d)

12

58.

A learner chooses a hypothesis that minimizes entropy but ignores generalization error. What bias does this introduce?

a)

Entropy bias

b)

Accuracy bias

c)

Overconfidence bias

d)

Prior-based bias

59.

Which of the following attributes will shrink version space faster?

a)

Irrelevant

b)

Redundant

c)

Discriminative

d)

Missing

60.

Which feature selection metric is used in C4.5 algorithm?

a)

Chi-square

b)

Information Gain

c)

Gain Ratio

d)

Mean Decrease Accuracy

61.

Sample complexity refers to:

a)

Model size

b)

Number of features

c)

Data needed for accuracy

d)

Runtime

62.

If a model gives zero weight to rare features during training, what kind of bias is introduced?

a)

Regularization bias

b)

Frequency bias

c)

Overfitting bias

d)

Capacity bias

63.

In MDL, what is the best model?

a)

Minimizes data

b)

Minimizes total encoding

c)

Maximizes likelihood

d)

Reduces entropy

64.

Which expression selects the diagonal of np.array([[1,2,3],[4,5,6],[7,8,9]])?

a)

np.diag(arr)

b)

arr[:,0]

c)

arr[::2]

d)

arr.diagonal()

65.

How to load CSV file into Pandas with header at first row?

a)

pd.read_csv('f.csv')

b)

pd.load_csv('f.csv')

c)

np.load('f.csv')

d)

pd.open('f.csv')

66.

Which algorithm gives the best prediction if prior and likelihood are known?

a)

KNN

b)

Bayes Optimal Classifier

c)

Perceptron

d)

Logistic Regression

67.

pd.DataFrame({'a':[1,2],'b':[3,4]}) creates how many

a)

1

b)

2

c)

4

d)

None

68.

Which Pandas function is used to combine data along columns with alignment on indexes?

a)

join()

b)

concat()

c)

merge()

d)

groupby()

69.

In KNN, the "K" refers to:

a)

Number of features

b)

Nearest neighbors

c)

Clusters

d)

Rules

70.

What defines the version space in concept learning?

a)

All data

b)

All concepts

c)

Consistent hypotheses

d)

Labeled instances

71.

In concept learning, if 3 out of 8 hypotheses are consistent with data, what's the version space size?

a)

3

b)

5

c)

8

d)

1

72.

Decision trees work best with which type of data?

a)

Continuous only

b)

Categorical

c)

Noisy

d)

Binary

73.

What is the time complexity of making a prediction with LWR using n training examples?

a)

O(n)

b)

O(log n)

c)

O(1)

d)

O(n2)O(n^2)

74.

For 20 hypotheses, and 90% confidence, μ=0.1, how many examples needed?

a)

Approximately 298

b)

Approximately 300

c)

Approximately 280

d)

Approximately 260

75.

A model uses bandwidth σ = 0.3 and distance from query point is 0.6. What is the exponent value in Gaussian weight formula?

a)

-1

b)

-2

c)

-0.5

d)

-1.5

76.

Output of arr = np.array([1,2,3,4]); arr[arr≥2]*2?

a)

[6 8]

b)

[3 4]

c)

[2 4 6 8]

d)

Error

77.

A dataset has 100 hypotheses, and 1 consistent hypothesis. What is the probability of picking it at random?

a)

0.01

b)

0.1

c)

0.5

d)

1

78.

What learning rate range ensures convergence without overshooting in perceptron?

a)

0.9–1.0

b)

0.1–0.5

c)

0.0–0.1

d)

>1.0

79.

Which method exports a Pandas DataFrame to a dictionary format?

a)

df.to_dict()

b)

df.save_dict()

c)

df.to_json()

d)

dict(df)

80.

When is LWR unsuitable?

a)

Real-time systems

b)

Structured data

c)

Missing values

d)

Small datasets

81.

A weight update is computed as -0.1. What does it mean?

a)

Increase weight

b)

Decrease weight

c)

Stop training

d)

Reset gradient

82.

For a test point, distances to 3 training points are [0.2, 0.5, 0.9]. Using Gaussian kernel with σ = 0.5, which point gets highest weight?

a)

First

b)

Second

c)

Third

d)

All equal

83.

Given df1 with index A, B and df2 with index B, C — df1.add(df2, fill_value=0) will result in:

a)

Index A, B, C

b)

Index A, B

c)

Index B, C

d)

Only C

84.

Given initial θ₁=0.5, data x=[1,0,1], after E-step π=[0.8,0.3,0.9], compute new θ₁ (mean of π³).

a)

0.67

b)

0.75

c)

0.65

d)

0.8

85.

What does EM (Expectation-Maximization) algorithm do?

a)

Reduces overfitting

b)

Handles missing data

c)

Normalizes input

d)

Converts to binary

86.

Which function is most used for binary classification?

a)

ReLU

b)

Softmax

c)

Sigmoid

d)

Tanh

87.

In Candidate Elimination, how are inconsistent hypotheses treated?

a)

Removed

b)

Modified

c)

Stored

d)

Merged

88.

Why is sigmoid rarely used in hidden layers of deep networks?

a)

High accuracy

b)

Large gradients

c)

Saturation issue

d)

Fast convergence

89.

Which of the following affects the convergence of EM?

a)

Initialization

b)

Step size

c)

Gradient

d)

Batch norm

90.

Why is the ReLU activation commonly used in deep networks?

a)

It is nonlinear

b)

Prevents vanishing gradients

c)

Linear output

d)

Makes output discrete

91.

Why is the perceptron learning rule guaranteed to converge?

a)

Fixed weights

b)

No learning

c)

Guaranteed

d)

Finite

92.

np.savetxt('test.txt', arr, fmt='%d') saves data in:

a)

Integer format

b)

Float format

c)

Binary

d)

String format

93.

What does Bayes' theorem help compute?

a)

Prior probability

b)

Posterior probability

c)

Mean value

d)

Error rate

94.

A disease affects 1% of a population. A test has 99% sensitivity and 95% specificity. What is the probability a person has the disease given a positive result?

a)

0.166

b)

0.5

c)

0.99

d)

0.01

95.

If initial population has poor fitness, what is GA’s long-term behavior?

a)

Stuck early

b)

Still improve

c)

Degrade performance

d)

Random converg

96.

If a DNN has 3 hidden layers with 100 neurons each, how many total neurons are there (excluding input and output)?

a)

300

b)

100

c)

102

d)

302

97.

A perceptron fails to classify a linearly non-separable function because:

a)

No update rule

b)

Not enough neurons

c)

Activation is weak

d)

Linear limitation

98.

In supervised learning, the data contains:

a)

Only inputs

b)

Only outputs

c)

No labels

d)

Input-output pairs

99.

In a test scenario, Class A has k=7k=7 neighbors: 3 close (0.2–0.4), 4 far (1.5–2.0). Using weighted voting, class prediction tends toward:

a)

Class A

b)

Class B

c)

Unknown

d)

Class C

100.

What is a key disadvantage of KNN?

a)

High accuracy

b)

Noisy predictions

c)

Lazy learning

d)

Small dataset needed

101.

Which of the following is NOT a property of instance-based learning?

a)

Fast training

b)

Lazy learning

c)

Storage intensive

d)

Feature selection

102.

What happens if we use a step activation function in training?

a)

Slower training

b)

Gradient vanishes

c)

Non-differentiable

d)

Always converges

103.

What does np.where(arr>3) return for arr = np.array([1,2,3,4,5])?

a)

(array([3, 4]))

b)

[4 5]

c)

1

d)

[3, 4]

104.

If L=0.125L=0.125 , log-likelihood (base 2) is?

a)

-2

b)

-3

c)

-4

d)

-1

105.

What causes error in probabilistic learning?

a)

Overtraining

b)

Wrong priors

c)

Zero variance

d)

Infinite data

106.

A dataset has 10,000 samples. How many models are trained to classify 1000 test instances in LWR?

a)

10

b)

1

c)

1000

d)

10000

107.

How many hypotheses are there in the version space if S = {Sunny, Warm, ?} and G = {?,?} after one positive example?

a)

2

b)

4

c)

6

d)

8

108.

Input: [2,1], Weights: [0.5, 0.5], Bias = 0.2 → ReLU output = ?

a)

1.2

b)

1

c)

0

d)

0.7

109.

For δ=0.1\delta = 0.1 and x=4x = 4 , with learning rate 0.25, what is the weight change?

a)

0.1

b)

-0.1

c)

-0.05

d)

-0.025

110.

If cosine distance = 0, what is the angle between the test and training vector?

a)

b)

90°

c)

180°

d)

Undefined

111.

Which splitting strategy is least sensitive to noise?

a)

Information Gain

b)

Gain Ratio

c)

Gini Index

d)

Chi-Square

112.

Similarity = 1 − normalized_distance. For distance 0.25, compute similarity.

a)

0.25

b)

0.5

c)

0.75

d)

1.25

113.

What will df.set_index('id') do?

a)

Set 'id' column as index

b)

Drop index

c)

Remove 'id'

d)

Create multi-index

114.

To concatenate DataFrames vertically, which axis is

a)

0

b)

1

c)

columns

d)

rows

115.

For Gaussian Mixture Model with 3 components, how many parameters (means) are learned?

a)

2

b)

3

c)

4

d)

1

116.

P(x1)=0.4, P(x2)=0.5, P(C)=0.3, P(x1|C)=0.7, P(x2|C)=0.8, P(x1,x2|¬C)=0.1. Find likelihood ratio.

a)

13.4

b)

12.5

c)

14.7

d)

11.2

117.

If hypothesis h1 has accuracy 0.6 and h2 has 0.8, what is error of Bayes Optimal Classifier if h2 is correct?

a)

0.2

b)

0.4

c)

0.1

d)

0.3

118.

In a noisy data scenario, what is the expected impact on the Candidate Elimination algorithm?

a)

Version space expands

b)

Version space collapses

c)

Hypotheses generalize

d)

S and G become identical

119.

When would you prefer Hamming distance over Euclidean?

a)

Real-valued features

b)

Categorical/binary

c)

Large datasets

d)

High variance

120.

You want smoother predictions using Gaussian kernel. Which adjustment to σ yields smoother predictions?

a)

Increase σ

b)

Decrease σ

c)

Set σ = 0

d)

Use Laplace

121.

Which of the following learning strategies is most suitable for maintaining a dynamic hypothesis boundary while minimizing version space?

a)

Eager learning

b)

Lazy learning

c)

Online learning

d)

Batch learning

122.

Which method can be used to search through hypothesis space?

a)

Gradient Descent

b)

Heuristic Space Search

c)

Beam Search

d)

Batch Normalization

123.

If EM convergence after 10 iterations reaches log-likelihood -55, and earlier was -70, what is the likelihood improvement?

a)

15

b)

10

c)

20

d)

25

124.

Output of np.sum(np.array([1,2,3,4]) > 2) is:

a)

2

b)

3

c)

1

d)

0

125.

If a decision tree is too deep and fits all training data, it is likely:

a)

Overfitting

b)

Underfitting

c)

Optimal

d)

Bias-free