WorksheetsMachine Learning and Neural Networks Worksheet
Total questions: 100
Worksheet time: 50mins
Learning from incomplete or partially observable data is referred to as:
Weak supervision
Clustering
Overfitting
Semi-supervised learning
Which of the following is a boolean classification algorithm?
Decision Tree
k-Means
Apriori
PCA
In a binary classification task, assuming equal prior probabilities for classes is what kind of bias?
Symmetric bias
Prior bias
Feature bias
Distribution bias
What does np.savetxt('file.txt', arr, delimiter=',') do?
CSV-style save
Tab-separated save
Save as JSON
Binary save
Which metric is most likely used in Maximum Likelihood estimation?
Distance
Probability
Entropy
Accuracy
The output layer of a classification neural network uses:
ReLU
Tanh
Softmax
Mean Pool
For a coin flipped 20 times with 14 heads, what is the MLE of P(H)?
0.7
0.6
0.5
0.65
A perceptron with inputs [1, 1] and weights [0.6, 0.6] has threshold 1.2. Output = ?
1
0
Cannot determine
-1
In a version space, what does the G boundary mean?
Generalized dataset
Most general hypothesis
Best performing model
Most specific output
Which of the following prevents internal covariate shift in deep networks?
Pooling
Batch normalization
ReLU
Gradient descent
Which strategy helps avoid premature convergence?
No crossover
High mutation
Elitism
Small population
You have 16 hypotheses, each classifying 20 instances. After 5 examples, 4 hypotheses remain. How many hypotheses?
12
4
8
10
Which method stacks columns into rows?
melt()
pivot()
groupby()
explode()
Which of the following is a greedy algorithm used for decision tree construction?
KNN
ID3
PCA
SVM
Which of the following best represents inductive bias?
Data collection process
Preference for certain hypotheses
Noise in input
Lack of features
Result of np.argmax(np.array([1,3,2,5,4])) is:
3
4
1
2
A two-layer MLP with 3 neurons each layer has how many weight connections (excluding bias)?
9
6
12
18
In RBF networks, the activation of a unit is highest when:
Far from center
Close to center
At any input
Zero weights
A dataset has 60 positive and 40 negative examples. What is the entropy?
0.971
1
0.881
0.5
If model has 10 parameters and log-likelihood is -300, what is MDL (approx)?
620
610
590
600
A model has log-likelihood -100 and 5 parameters. What is AIC?
210
205
200
195
Given a consistent learner, what is the max number of mistakes with 128 hypotheses?
128
64
7
8
What is candidate elimination used for?
Reducing training time
Learning weights
Finding all consistent hypotheses
Cleaning the dataset
In genetic algorithms, a chromosome represents:
A DNA string
A solution
An attribute
A population
Naïve Bayes fails when:
Features are correlated
Data is small
Priors are unknown
Too many classes
Which parameter in concat() can ignore duplicate indices?
ignore_index=True
drop_index=True
axis=1
index=False
A case receives 4.2 adaptation score from expert A, and 3.8 from expert B. Compute average.
3.9
4
4.1
4
Which search strategy is commonly used in concept learning?
Breadth First
Depth First
Beam Search
Candidate Elimination
What happens during mutation in GA?
Swap chromosome
Reverse optimization
Small change in solution
Delete worst solutions
Which method merges on index instead of columns?
join()
merge()
concat()
groupby()
Which metric would be most appropriate for binary attributes?
Cosine similarity
Euclidean
Hamming distance
Mahalanobis
What is concept learning concerned with?
Learning constraints
Identifying features
Learning a Boolean function
Sorting algorithms
Compute Manhattan distance between (1,2,3) and (4,0,6).
6
8
10
12
What is a major disadvantage of LWR?
No categorical data
High training time
High prediction cost
Ignores prior knowledge
Probability of x under θ=0.4 is 0.2, under θ=0.6 is 0.4. Which θ is chosen in M-step?
0.4
0.6
Both
Cannot decide
Why might LWR fail in high dimensions?
Curse of dimensionality
No closed-form
Inflexible kernel
Poor residuals
In a binary classification, P(C1)=0.6, P(C2)=0.4, P(x|C1)=0.3, P(x|C2)=0.5.
0.31
0.56
0.69
0.45
A perceptron misclassifies input [1,0] with weight [0.5,0.3]. Update weights for class=1 with lr=0.2.
[0.7, 0.3]
[0.5, 0.5]
[0.6, 0.4]
[0.3, 0.3]
Which algorithm finds the smallest consistent hypothesis first?
Find-S
Candidate-Elimination
ID3
Backpropagation
A dataset has 1000 samples. For LWR with local linear regression, how many models are trained to predict 10 new points?
1
10
1000
10000
Hidden layer neuron receives inputs [2, 1] with weights [0.3, 0.4]. What is the linear combination output?
1
0.7
1.4
1.1
Which is a benefit of genetic algorithms?
Always converges
Handles non-linear spaces
Requires labeled data
Needs large datasets
What happens if all initial weights are zero and inputs are [0,0]?
Always zero
Can’t train
Output = 1
Which layer in neural networks receives raw input?
Hidden layer
Output layer
Input layer
ReLU layer
Why is Candidate Elimination considered a deterministic learner?
It uses rules
It memorizes data
It eliminates hypotheses
It relies on entropy
A perceptron receives weight vector [1, 1], input [1, 1], and threshold 2.0. Output = ?
1
0
-1
Cannot determine
df['new'] = df['x'] * 2 performs what kind of operation?
Vectorized
Scalar
Loop-based
Recursive
A learner trained on dogs classifies horses as dogs. What does this indicate about its inductive bias?
Overfitting bias
Generalization failure
Negative transfer bias
Representation mismatch
Which attribute returns the number of elements in an ndarray?
.size
.shape
.dtype
.ndim
BOC is most useful when...
Low variance
Noisy labels
Single hypothesis
High bias
Which metric is not commonly used in decision trees?
Gini Index
Information Gain
Entropy
RMSE
If a = np.array([[1,2],[3,4]]), what is a[1,1]?
2
3
4
1
Given df1 with index A, B and df2 with index B, C — df1.add(df2, fill_value=0) will result in:
Index A, B
Index A, B, C
Only C
Index B, C
What does the following return: np.array([1,2,3]) * 2?
[2 4 6]
[1 2 3 2 3]
[1,4,9]
Error
What does the MDL (Minimum Description Length) principle prefer?
Complex models
Shorter encoded models
Deeper trees
Fewer samples
Which strategy does Find-S algorithm follow?
Most specific hypothesis
Most general hypothesis
Random selection
Max likelihood
A learner rejects complex hypotheses regardless of fit. What is this preference called?
Structural bias
Hypothesis-limiting bias
Simplicity bias
Accuracy bias
How many samples are needed to guarantee with 95% confidence an error less than 0.1 from hypothesis class of size 10?
299
230
240
100
Given a hypothesis space H with 128 hypotheses, how many binary classification functions are learnable without inductive bias?
128
2128
log2(128)
0
Pruning in decision trees is used to:
Increase tree depth
Improve accuracy
Prevent overfitting
Enhance entropy
When G has multiple general hypotheses and S has a narrow specific one, what does this indicate?
Overfitting
Bias
Uncertainty
Clarity
What does np.arange(2,10,2) return?
[2,4,6,8]
[2,3,4,5,6,7,8,9]
[2,6,10]
[3,5,7,9]
Gibbs Algorithm randomly selects hypothesis using...
Training error
Posterior distribution
Likelihood
Margin
In Mahalanobis distance, what happens if features are highly correlated?
Distance increases
Distance becomes Euclidean
Distance becomes small
Distance ignores correlation
If log-likelihood = -250 and 8 parameters, what is AIC?
516
500
520
508
A binary classifier predicts correctly 90 out of 120 samples. What is its accuracy?
0.6
0.9
0.75
0.8
Which of these is true for BBN inference?
Exact in polynomial time
Always approximated
NP-hard
Logarithmic
Which step of EM estimates parameters?
A) Expectation
B) Maximization
C) Both
D) Neither
Which kernel function results in the highest weight for closer points?
Gaussian
Uniform
Linear
Triangular
Which operation keeps all keys from both DataFrames?
Outer Join
Inner Join
Left join
Right join
In real-world problems, model performance is mostly evaluated using:
Training error
Confusion matrix
Generalization error
Time complexity
BBNs are used for:
Classification only
Causal inference
Clustering
Regression
For a dataset with high-dimensional features, which distance measure degrades?
Euclidean
Manhattan
Cosine
Jaccard
Compute the Euclidean distance between points (1,2) and (4,6).
3
5
V18
V20
A softmax output layer is most suitable for which type of task?
Regression
Binary classification
Multi-class classification
Clustering
MLE for normal distribution uses which estimator for mean?
Mode
Sample mean
Variance
Median
If BOC chooses class with probability 0.7, what is the uncertainty?
0.3
0.7
0.49
0.21
Given 3 hypotheses with accuracies [0.7, 0.6, 0.9], and uniform priors, which dominates BOC?
h1
h3
h2
None
For a binary classification, 5 neighbors vote [3:Class 1, 2:Class 2], but Class 2 has higher average proximity. What's the label in weighted voting?
Class 1
Class 2
Cannot say
Depends on data size
The S boundary in candidate elimination represents:
Most specific hypothesis
Most general hypothesis
Training data
Prediction error
Infinite hypothesis space leads to:
Higher sample complexity
Faster convergence
Fewer updates
Regularization
What is the purpose of a learning rate in backpropagation?
Control overfitting
Scale weight
Remove noise
Increase depth
Which strategy is used to prefer one hypothesis over another in concept learning?
Gradient descent
Backpropagation
Inductive bias
Entropy minimization
What is fitness landscape in GA context?
Algorithm
Error surface
Evaluation graph
Search space contour
Hypothesis H1 has 0.7 accuracy on D1 (size=20) and H2 has 0.9 on D2 (size=10). Which has better likelihood?
H1
H2
Equal
Cannot determine
Which function is used to save a NumPy array as text?
np.savetxt()
np.save()
np.dump()
np.write()
Which of these is most likely to cause overfitting in a neural network?
Too little training
Large dataset
Too many parameter
Shallow architecture
Overfitting occurs when:
Model is too simple
Model is too noisy
Noisy data
Features are correlated
In coin toss, with 3 H, 2 T, what is MLE for p, (prob of H)?
0.6
0.5
0.7
0.4
Given priors P(h1)=0.3, P(h2)=0.7 and P(x|h1)=0.2, P(x|h2)=0.5, compute P(x)
0.41
0.5
0.29
0.37
A neuron receives error δ=0.2 and input x=0.5. What is the weight update using learning rate
0.01
0.005
0.02
0.015
Given a np.array([[1,2],[3,4]]), what is np.sum(a, axis=1)?
[3 7]
[4 6]
[1 3]
[2 4]
For input [2, 2] and weights [0.5, -0.5], what is the net sum?
0
2
-2
1
In a 3-attribute Boolean space, if S = (Sunny,?,?), G = (?, ?,?), what type of boundaries do S and G form?
S ⊆ G
G ⊆ S
S ∩ G = ∅
S = G
Total error is calculated using:
Mean error
Mean squared error
Absolute error
Maximum error
What is the type of the object returned by np.array([1,2,3]) > 1?
ndarray of bool
list
int
float
What is returned by np.array([[1,2,3,4,5]])[[0,2,4]]?
[1 3 5]
[0 2 4]
[1 2 3]
[2 4 5]
What is the output of a sigmoid function always between?
-1 to 1
0 to 1
-∞ to +∞
0 to 10
What improves LWR prediction without increasing computational cost?
Increase data size
Regularization
Use distance
Fit neural net
You flip a biased coin 10 times: 7 heads. What's the MLE of P(heads)?
0.7
0.5
0.3
0.6
