WorksheetsData Science and Machine Learning Worksheet
Total questions: 100
Worksheet time: 50mins
Tournament selection compares how many individuals typically?
1
2
3
4
If a = np.array([1,2,3,4]), what is a[1:-1]?
[2,3]
[1,2]
[3,4]
[2,3,4]
Which technique is commonly used to select centers in RBF?
PCA
SVD
K-means
Backpropagation
Which of the following does not apply to CBR systems?
Rule-based adaptation
Continuous learning
Memory-intensive
Relies on past data
In a dataset with standardized features, which metric ensures fair distance?
Manhattan
Mahalanobis
Hamming
Cosine
Which function gives the index of the minimum value in a 1D array?
np.argmin()
np.index()
np.minindex()
np.where()
Bayesian Belief Network (BBN) represents:
Probabilistic dependence
Rule-based reasoning
Time series
Neural layers
The number of possible hypotheses in a hypothesis space with 3 binary attributes is:
6
8
27
16
pd.DataFrame({'a':[1,2], 'b':[3,4]}) creates how many rows?
1
2
4
None
Initial weight is 0.5. After seeing a misclassified example with input 1 and true output 1, update
0.4
0.5
0.6
0.7
What is expected error of Gibbs Algorithm if best hypothesis has 0.2 error?
0.2
0.3
0.4
Cannot say
Genetic Programming (GP) is a form of:
Unsupervised learning
Reinforcement learning
Evolutionary algorithm
Bayesian method
When is dropout most beneficial in training?
Small dataset
Noisy input
Overfitting tendency
Large weights
In concept learning, the inductive step moves from:
Training to test
Specific to general
Examples to rules
Clusters to clusters
What is the output type of ndarray?
list
dict
string
array
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?
0.25
0.2
0.22
0.26
A dataset has 5 RBF neurons, each centered at different clusters. What does increasing σ generally do?
Sharpens peaks
Widens responses
Causes overfitting
Decreases output
If np.save('data.npz', a=x, b=y), how do you access a later?
data['a']
data.a
data.get('a')
data[0]
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).
0.06
0.08
0.05
0.1
Merging two DataFrames on a common column uses which function?
merge
concat
append
join
A dataset has 3 features: [0-1], [0-100], and [0-10000]. Which pre-processing is essential for KNN to perform well?
PCA
Label Encoding
Normalization
None
Given P(H)=0.6, P(E|H)=0.5, P(E|Ā,H)=0.2, compute P(H|E) using Bayes theorem.
0.789
0.75
0.6
0.8
What does df.shape return for a DataFrame with 5 rows and 3 columns?
(5,3)
5
3
[5,3]
Gradient clipping helps in:
Convergence
Preventing explosion
Dropout
Bias correction
What is the output of: np.array([1,2,3]) * np.array([4,5,6])?
[5 7 9]
[4 6 8]
[1 2 3 4 5 6]
Error
Which distance metric is least affected by outliers?
Euclidean
Manhattan
Chebyshev
Mahalanobis
A 2D feature space is scaled non-uniformly. After min-max normalization, KNN accuracy improves. Why?
A) Separability
B) Equal contribution
C) Lower error
D) Larger margin
What defines the generalization ability of a model?
High training accuracy
Low training time
Performance on unseen data
Number of layers
A model trained with decision trees prefers attribute splits with lower entropy. This reflects which bias?
Heuristic bias
Noise bias
Preference bias
Class imbalance bias
A small kernel bandwidth in LWR typically leads to:
Underfitting
High bias
Overfitting
Better generalization
A case base with 250 entries is searched. If search is O(logN), what is the estimated cost in entries checked?
log(250)
250
v250
125
You apply RBF with σ = 0.1 to distant points. What happens to neuron activation?
Near 1
Near 0
Constant
Randomized
The mistake bound model measures:
Max mistakes before learning
Error rate
Test performance
Sample diversity
Probability of observing instance x given class C is 0.4, and prior of class is 0.3. Find joint
0.12
0.3
0.7
0.1
How can version space be used to assess model uncertainty?
By measuring its size
By using entropy
Through clustering
By computing variance
Which method combines DataFrames column-wise?
pd.concat(..., axis=1)
pd.merge()
pd.join()
pd.combine()
Which logic gate is not representable by a single-layer perceptron?
A) AND
B) OR
C) NOT
D) XOR
You randomly pick a consistent hypothesis from version space of 5. What’s the chance it’s correct under noise-free learning?
1
0.2
0.5
Depends on prior
What is the extension used by default when saving DataFrame to Excel?
.xlsx
.xls
.csv
.json
Which of the following learning strategies best aligns with Occam's Razor principle as inductive bias?
Choosing shortest decision tree
Selecting most complex classifier
Using ensemble models
Maximizing margin
Which is NOT an assumption of Bayesian learning?
Noise-free data
Prior distribution
Conditional independence
Likelihood model
What happens when the version space becomes empty in concept learning?
Overfitting
No consistent hypo
Hypothesis found
Accuracy is perfect
A KNN model shows 98% training accuracy and 61% test accuracy. What does this indicate?
Data drift
Overfitting
Underfitting
Poor class balance
What is the entropy of a dataset with class probabilities [0.3, 0.7]?
0.88
0.81
0.91
0.76
Which function gives the first 5 rows of a DataFrame?
df.head()
df.tail()
df.sample()
df.describe()
Models of evaluation in GA are primarily used to:
Choose parents
Apply mutation
Compute fitness
Track generation
Training stops in perceptron when:
Max accuracy
All weights = 0
No updates required
Epoch ends
A consistent hypothesis is one that:
Fits only test data
Matches all training examples
Predicts all inputs
Always overfits
A concept is defined over 4 Boolean attributes. How many possible instances exist in the instance space?
8
16
32
64
A high cosine similarity between two vectors indicates:
They are perpendicular
High angle difference
They point in same direction
Large magnitude
Probability learning involves estimation of:
Posterior distributions
Gradient descent
Hypothesis error
Entropy
Which assumption is made in Naïve Bayes?
Feature independence
Gaussian noise
Linear boundary
Equal priors
If the net input is 0.9 and threshold is 0.8, what is the perceptron output with step?
1
0
0.5
-1
What type of join keeps only common rows between two DataFrames?
Inner
Left
Right
A
Which training step in RBF is often unsupervised?
Output weights
Center selection
Kernel computation
Loss reduction
Given hypothesis h with P(h|D) = 0.6, P(h|I) = 0.3, P(h|J) = 0.5, compute P(h|D)?
0.3
0.6
0.5
0.1
Which of the following is NOT required in a concept learning system?
Target concept
Hypothesis space
Examples
Test loss
Which method can reset DataFrame index?
reset_index()
reindex()
drop_index()
set_index()
A network has 10 layers and training loss does not decrease. Likely cause?
High dropout
Vanishing gradient
Overfitting
Low batch size
What will np.savez_compressed() do?
Save .npz with zip
Save in plain text
Save in float16
Save as list
Which of the following is a global optimization technique?
ID3
Backpropagation
Genetic Algorithm
Naive Bayes
If a model is underfitting, which of the following is likely?
High training accuracy
High test accuracy
High bias
Low bias
To concatenate DataFrames vertically, which axis is used?
0
1
columns
rows
RBF network with 10 hidden neurons is trained on 100 samples. What's dimensionality of hidden-to-output weights (1 output node)?
100×10
10×1
1×10
10×100
In the hypothesis (1,0,?), how many of the 8 possible 3-bit instances does it match?
1
2
4
6
The maximum coordinate difference in Chebyshev distance between (7,2) and (3,6)
4
5
3
2
Genetic algorithms work based on the principle of:
Probability theory
Natural selection
Gradient descent
Matrix transformation
Which type of inductive bias explicitly constrains the form of the learned
Preference bias
Representation bias
Greedy bias
Prior belief bias
Maximum Likelihood Estimation aims to:
Minimize loss
Maximize probability
Eliminate features
Normalize data
In DNN, which problem arises due to vanishing gradients?
Overfitting
Slow convergence
Non-linearity
Ineffective learning
What type of learning is KNN considered?
Eager
Lazy
Supervised
Unsupervised
After crossover between 1100 and 0011 at point 2, what are offspring?
1101, 0010
1111, 0000
1100, 0011
1100, 1111
Entropy before splitting is 0.94. After split using attribute A, entropy is 0.7. What is information
0.14
0.24
0.3
0.94
Which parameter maximizes P(D|j) in MLE?
j, maximizing prior
j, minimizing loss
j, maximizing likelihood
j, minimizing entropy
When does S boundary expand in the Candidate Elimination process?
On positive example
On negative example
On missing features
On generalization
A consistent hypothesis is one that:
Is always correct
Is closest to input values
Agrees with all training data
Has least parameters
In a single-layer perceptron, the output is based on:
Weighted sum + bias
Input mean
Output sum
Hidden node average
Learning curve shows:
Accuracy over data size
Tree height over time
Cost of training
Model complexity
A model prefers hypotheses with the lowest empirical risk. Which bias is dominant?
Statistical bias
Risk minimization
Simplicity bias
Structural bias
How many hypotheses remain in the version space if 3 examples eliminate half the previous
32
16
8
4
Which of the following best describes the limitation of a single-layer perceptron?
Requires big data
No hidden layers
Non-linear classifier
Needs backprop
Retrieval cost is 0.2ms per case. For 1,000 cases, what's the total retrieval time in ms?
200
2
20
0.02
What is the Euclidean distance between vectors A = [3, 4, 5] and B = [0, 0, 0]?
7
5
√50
√32
For weights [0.5, 0.3], input [2, 4], and threshold 2.5, does the perceptron
Yes
No
Maybe
Depends on bias
np.savetxt('a.txt', np.array([[2,1],[3,4]])) writes how many rows?
2
1
4
3
Which of the following is an advantage of KNN?
Compact model
No training time
Efficient memory usage
High-dimensional support
Hypothesis space in GA refers to:
All possible data
All possible outputs
All possible solutions
Final result only
In a GA, population size = 20, each individual has fitness score. What is the total fitness if average fitness = 5?
100
25
10
5
For arr = np.array([1,2,3,4,5]), what is arr[arr%2==0]?
[2,4]
[1,3,5]
[0,1,0,1,0]
Error
Given posterior P(h1|D)=0.5, P(h2|D)=0.5, and h1/h2 disagree on x, what does BOC?
Random
Majority vote
Reject
Both classes
Which NumPy function computes element-wise maximum from two arrays?
np.maximum()
np.max()
np.argmax()
np.clip()
When no prior knowledge is encoded, what limits learning from small datasets?
Lack of representation
Too much noise
Absence of bias
High variance
A case library contains 200 entries. If 80 cases are retrieved, how many were left?
100
120
140
160
What is returned by: a = np.array([1,2,3,4,5]); a[::-1]?
[5 4 3 2 1]
[1 2 3 4 5]
[5 3 1]
Error
What does "deep" refer to in deep learning?
Wide data
Many layers
Long training time
Memory usage
Which format supports saving mixed data types best?
.npz
.csv
.npy
.txt
What is the result of np.mean(np.array([[1,2],[3,4]]), axis=0)?
[2, 3]
2.5
[1.5, 3.5]
[3, 4]
A layer has 8 neurons, each connected to 10 inputs. What is the total weight count?
A) 80
B) 88
C) 90
D) 100
A BBN with 4 nodes and full connectivity has how many conditional probability tables?
4
5
6
8
What is the number of connections between a 5-node input and a 4-node output?
20
9
25
10
