wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Data Science and Machine Learning Worksheet

Total questions: 100

Worksheet time: 50mins

Name
Class
Date
1.

Tournament selection compares how many individuals typically?

a)

1

b)

2

c)

3

d)

4

2.

If a = np.array([1,2,3,4]), what is a[1:-1]?

a)

[2,3]

b)

[1,2]

c)

[3,4]

d)

[2,3,4]

3.

Which technique is commonly used to select centers in RBF?

a)

PCA

b)

SVD

c)

K-means

d)

Backpropagation

4.

Which of the following does not apply to CBR systems?

a)

Rule-based adaptation

b)

Continuous learning

c)

Memory-intensive

d)

Relies on past data

5.

In a dataset with standardized features, which metric ensures fair distance?

a)

Manhattan

b)

Mahalanobis

c)

Hamming

d)

Cosine

6.

Which function gives the index of the minimum value in a 1D array?

a)

np.argmin()

b)

np.index()

c)

np.minindex()

d)

np.where()

7.

Bayesian Belief Network (BBN) represents:

a)

Probabilistic dependence

b)

Rule-based reasoning

c)

Time series

d)

Neural layers

8.

The number of possible hypotheses in a hypothesis space with 3 binary attributes is:

a)

6

b)

8

c)

27

d)

16

9.

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

a)

1

b)

2

c)

4

d)

None

10.

Initial weight is 0.5. After seeing a misclassified example with input 1 and true output 1, update

a)

0.4

b)

0.5

c)

0.6

d)

0.7

11.

What is expected error of Gibbs Algorithm if best hypothesis has 0.2 error?

a)

0.2

b)

0.3

c)

0.4

d)

Cannot say

12.

Genetic Programming (GP) is a form of:

a)

Unsupervised learning

b)

Reinforcement learning

c)

Evolutionary algorithm

d)

Bayesian method

13.

When is dropout most beneficial in training?

a)

Small dataset

b)

Noisy input

c)

Overfitting tendency

d)

Large weights

14.

In concept learning, the inductive step moves from:

a)

Training to test

b)

Specific to general

c)

Examples to rules

d)

Clusters to clusters

15.

What is the output type of ndarray?

a)

list

b)

dict

c)

string

d)

array

16.

What is the probability of evidence E, given P(E|C)=0.4, P(C)=0.5, P(E|Ā,C)=0.1, P(Ā)=0.5?

a)

0.25

b)

0.2

c)

0.22

d)

0.26

17.

A dataset has 5 RBF neurons, each centered at different clusters. What does increasing σ generally do?

a)

Sharpens peaks

b)

Widens responses

c)

Causes overfitting

d)

Decreases output

18.

If np.save('data.npz', a=x, b=y), how do you access a later?

a)

data['a']

b)

data.a

c)

data.get('a')

d)

data[0]

19.

If P(A)=0.2, P(B|A)=0.5, P(C|A,B)=0.6 in a BBN, compute joint P(A,B,C).

a)

0.06

b)

0.08

c)

0.05

d)

0.1

20.

Merging two DataFrames on a common column uses which function?

a)

merge

b)

concat

c)

append

d)

join

21.

A dataset has 3 features: [0-1], [0-100], and [0-10000]. Which pre-processing is essential for KNN to perform well?

a)

PCA

b)

Label Encoding

c)

Normalization

d)

None

22.

Given P(H)=0.6, P(E|H)=0.5, P(E|Ā,H)=0.2, compute P(H|E) using Bayes theorem.

a)

0.789

b)

0.75

c)

0.6

d)

0.8

23.

What does df.shape return for a DataFrame with 5 rows and 3 columns?

a)

(5,3)

b)

5

c)

3

d)

[5,3]

24.

Gradient clipping helps in:

a)

Convergence

b)

Preventing explosion

c)

Dropout

d)

Bias correction

25.

What is the output of: np.array([1,2,3]) * np.array([4,5,6])?

a)

[5 7 9]

b)

[4 6 8]

c)

[1 2 3 4 5 6]

d)

Error

26.

Which distance metric is least affected by outliers?

a)

Euclidean

b)

Manhattan

c)

Chebyshev

d)

Mahalanobis

27.

A 2D feature space is scaled non-uniformly. After min-max normalization, KNN accuracy improves. Why?

a)

A) Separability

b)

B) Equal contribution

c)

C) Lower error

d)

D) Larger margin

28.

What defines the generalization ability of a model?

a)

High training accuracy

b)

Low training time

c)

Performance on unseen data

d)

Number of layers

29.

A model trained with decision trees prefers attribute splits with lower entropy. This reflects which bias?

a)

Heuristic bias

b)

Noise bias

c)

Preference bias

d)

Class imbalance bias

30.

A small kernel bandwidth in LWR typically leads to:

a)

Underfitting

b)

High bias

c)

Overfitting

d)

Better generalization

31.

A case base with 250 entries is searched. If search is O(logN), what is the estimated cost in entries checked?

a)

log(250)

b)

250

c)

v250

d)

125

32.

You apply RBF with σ = 0.1 to distant points. What happens to neuron activation?

a)

Near 1

b)

Near 0

c)

Constant

d)

Randomized

33.

The mistake bound model measures:

a)

Max mistakes before learning

b)

Error rate

c)

Test performance

d)

Sample diversity

34.

Probability of observing instance x given class C is 0.4, and prior of class is 0.3. Find joint

a)

0.12

b)

0.3

c)

0.7

d)

0.1

35.

How can version space be used to assess model uncertainty?

a)

By measuring its size

b)

By using entropy

c)

Through clustering

d)

By computing variance

36.

Which method combines DataFrames column-wise?

a)

pd.concat(..., axis=1)

b)

pd.merge()

c)

pd.join()

d)

pd.combine()

37.

Which logic gate is not representable by a single-layer perceptron?

a)

A) AND

b)

B) OR

c)

C) NOT

d)

D) XOR

38.

You randomly pick a consistent hypothesis from version space of 5. What’s the chance it’s correct under noise-free learning?

a)

1

b)

0.2

c)

0.5

d)

Depends on prior

39.

What is the extension used by default when saving DataFrame to Excel?

a)

.xlsx

b)

.xls

c)

.csv

d)

.json

40.

Which of the following learning strategies best aligns with Occam's Razor principle as inductive bias?

a)

Choosing shortest decision tree

b)

Selecting most complex classifier

c)

Using ensemble models

d)

Maximizing margin

41.

Which is NOT an assumption of Bayesian learning?

a)

Noise-free data

b)

Prior distribution

c)

Conditional independence

d)

Likelihood model

42.

What happens when the version space becomes empty in concept learning?

a)

Overfitting

b)

No consistent hypo

c)

Hypothesis found

d)

Accuracy is perfect

43.

A KNN model shows 98% training accuracy and 61% test accuracy. What does this indicate?

a)

Data drift

b)

Overfitting

c)

Underfitting

d)

Poor class balance

44.

What is the entropy of a dataset with class probabilities [0.3, 0.7]?

a)

0.88

b)

0.81

c)

0.91

d)

0.76

45.

Which function gives the first 5 rows of a DataFrame?

a)

df.head()

b)

df.tail()

c)

df.sample()

d)

df.describe()

46.

Models of evaluation in GA are primarily used to:

a)

Choose parents

b)

Apply mutation

c)

Compute fitness

d)

Track generation

47.

Training stops in perceptron when:

a)

Max accuracy

b)

All weights = 0

c)

No updates required

d)

Epoch ends

48.

A consistent hypothesis is one that:

a)

Fits only test data

b)

Matches all training examples

c)

Predicts all inputs

d)

Always overfits

49.

A concept is defined over 4 Boolean attributes. How many possible instances exist in the instance space?

a)

8

b)

16

c)

32

d)

64

50.

A high cosine similarity between two vectors indicates:

a)

They are perpendicular

b)

High angle difference

c)

They point in same direction

d)

Large magnitude

51.

Probability learning involves estimation of:

a)

Posterior distributions

b)

Gradient descent

c)

Hypothesis error

d)

Entropy

52.

Which assumption is made in Naïve Bayes?

a)

Feature independence

b)

Gaussian noise

c)

Linear boundary

d)

Equal priors

53.

If the net input is 0.9 and threshold is 0.8, what is the perceptron output with step?

a)

1

b)

0

c)

0.5

d)

-1

54.

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

a)

Inner

b)

Left

c)

Right

d)

A

55.

Which training step in RBF is often unsupervised?

a)

Output weights

b)

Center selection

c)

Kernel computation

d)

Loss reduction

56.

Given hypothesis h with P(h|D) = 0.6, P(h|I) = 0.3, P(h|J) = 0.5, compute P(h|D)?

a)

0.3

b)

0.6

c)

0.5

d)

0.1

57.

Which of the following is NOT required in a concept learning system?

a)

Target concept

b)

Hypothesis space

c)

Examples

d)

Test loss

58.

Which method can reset DataFrame index?

a)

reset_index()

b)

reindex()

c)

drop_index()

d)

set_index()

59.

A network has 10 layers and training loss does not decrease. Likely cause?

a)

High dropout

b)

Vanishing gradient

c)

Overfitting

d)

Low batch size

60.

What will np.savez_compressed() do?

a)

Save .npz with zip

b)

Save in plain text

c)

Save in float16

d)

Save as list

61.

Which of the following is a global optimization technique?

a)

ID3

b)

Backpropagation

c)

Genetic Algorithm

d)

Naive Bayes

62.

If a model is underfitting, which of the following is likely?

a)

High training accuracy

b)

High test accuracy

c)

High bias

d)

Low bias

63.

To concatenate DataFrames vertically, which axis is used?

a)

0

b)

1

c)

columns

d)

rows

64.

RBF network with 10 hidden neurons is trained on 100 samples. What's dimensionality of hidden-to-output weights (1 output node)?

a)

100×10

b)

10×1

c)

1×10

d)

10×100

65.

In the hypothesis (1,0,?), how many of the 8 possible 3-bit instances does it match?

a)

1

b)

2

c)

4

d)

6

66.

The maximum coordinate difference in Chebyshev distance between (7,2) and (3,6)

a)

4

b)

5

c)

3

d)

2

67.

Genetic algorithms work based on the principle of:

a)

Probability theory

b)

Natural selection

c)

Gradient descent

d)

Matrix transformation

68.

Which type of inductive bias explicitly constrains the form of the learned

a)

Preference bias

b)

Representation bias

c)

Greedy bias

d)

Prior belief bias

69.

Maximum Likelihood Estimation aims to:

a)

Minimize loss

b)

Maximize probability

c)

Eliminate features

d)

Normalize data

70.

In DNN, which problem arises due to vanishing gradients?

a)

Overfitting

b)

Slow convergence

c)

Non-linearity

d)

Ineffective learning

71.

What type of learning is KNN considered?

a)

Eager

b)

Lazy

c)

Supervised

d)

Unsupervised

72.

After crossover between 1100 and 0011 at point 2, what are offspring?

a)

1101, 0010

b)

1111, 0000

c)

1100, 0011

d)

1100, 1111

73.

Entropy before splitting is 0.94. After split using attribute A, entropy is 0.7. What is information

a)

0.14

b)

0.24

c)

0.3

d)

0.94

74.

Which parameter maximizes P(D|j) in MLE?

a)

j, maximizing prior

b)

j, minimizing loss

c)

j, maximizing likelihood

d)

j, minimizing entropy

75.

When does S boundary expand in the Candidate Elimination process?

a)

On positive example

b)

On negative example

c)

On missing features

d)

On generalization

76.

A consistent hypothesis is one that:

a)

Is always correct

b)

Is closest to input values

c)

Agrees with all training data

d)

Has least parameters

77.

In a single-layer perceptron, the output is based on:

a)

Weighted sum + bias

b)

Input mean

c)

Output sum

d)

Hidden node average

78.

Learning curve shows:

a)

Accuracy over data size

b)

Tree height over time

c)

Cost of training

d)

Model complexity

79.

A model prefers hypotheses with the lowest empirical risk. Which bias is dominant?

a)

Statistical bias

b)

Risk minimization

c)

Simplicity bias

d)

Structural bias

80.

How many hypotheses remain in the version space if 3 examples eliminate half the previous

a)

32

b)

16

c)

8

d)

4

81.

Which of the following best describes the limitation of a single-layer perceptron?

a)

Requires big data

b)

No hidden layers

c)

Non-linear classifier

d)

Needs backprop

82.

Retrieval cost is 0.2ms per case. For 1,000 cases, what's the total retrieval time in ms?

a)

200

b)

2

c)

20

d)

0.02

83.

What is the Euclidean distance between vectors A = [3, 4, 5] and B = [0, 0, 0]?

a)

7

b)

5

c)

√50

d)

√32

84.

For weights [0.5, 0.3], input [2, 4], and threshold 2.5, does the perceptron

a)

Yes

b)

No

c)

Maybe

d)

Depends on bias

85.

np.savetxt('a.txt', np.array([[2,1],[3,4]])) writes how many rows?

a)

2

b)

1

c)

4

d)

3

86.

Which of the following is an advantage of KNN?

a)

Compact model

b)

No training time

c)

Efficient memory usage

d)

High-dimensional support

87.

Hypothesis space in GA refers to:

a)

All possible data

b)

All possible outputs

c)

All possible solutions

d)

Final result only

88.

In a GA, population size = 20, each individual has fitness score. What is the total fitness if average fitness = 5?

a)

100

b)

25

c)

10

d)

5

89.

For arr = np.array([1,2,3,4,5]), what is arr[arr%2==0]?

a)

[2,4]

b)

[1,3,5]

c)

[0,1,0,1,0]

d)

Error

90.

Given posterior P(h1|D)=0.5, P(h2|D)=0.5, and h1/h2 disagree on x, what does BOC?

a)

Random

b)

Majority vote

c)

Reject

d)

Both classes

91.

Which NumPy function computes element-wise maximum from two arrays?

a)

np.maximum()

b)

np.max()

c)

np.argmax()

d)

np.clip()

92.

When no prior knowledge is encoded, what limits learning from small datasets?

a)

Lack of representation

b)

Too much noise

c)

Absence of bias

d)

High variance

93.

A case library contains 200 entries. If 80 cases are retrieved, how many were left?

a)

100

b)

120

c)

140

d)

160

94.

What is returned by: a = np.array([1,2,3,4,5]); a[::-1]?

a)

[5 4 3 2 1]

b)

[1 2 3 4 5]

c)

[5 3 1]

d)

Error

95.

What does "deep" refer to in deep learning?

a)

Wide data

b)

Many layers

c)

Long training time

d)

Memory usage

96.

Which format supports saving mixed data types best?

a)

.npz

b)

.csv

c)

.npy

d)

.txt

97.

What is the result of np.mean(np.array([[1,2],[3,4]]), axis=0)?

a)

[2, 3]

b)

2.5

c)

[1.5, 3.5]

d)

[3, 4]

98.

A layer has 8 neurons, each connected to 10 inputs. What is the total weight count?

a)

A) 80

b)

B) 88

c)

C) 90

d)

D) 100

99.

A BBN with 4 nodes and full connectivity has how many conditional probability tables?

a)

4

b)

5

c)

6

d)

8

100.

What is the number of connections between a 5-node input and a 4-node output?

a)

20

b)

9

c)

25

d)

10