Sample Questions for Machine Learning:
Question#1:
Given a function:
f(x)=−5x+0.1
What is the local minimum of the function starting from the point x=0, and what is the value of x
after the first iteration using gradient descent with a learning rate of 0.01? How many iterations
are required to reach a negative value?
Question #2:
There are two boxes. The first box contains 3 white and 2 red balls whereas the second contains 5
white and 4 red balls. A ball is drawn at random from one of the two boxes and is found to be
white. Find the probability that the ball was drawn from the second box?
Question #3:
What is the cost function C from the following data by using Mean Square Error (MSE)?
C = 1/n∑𝑛𝑖=1(𝑦𝑖 − 𝑦𝑖′ )2
Expected output 15 17 10 26 14 12 11 13
Actual output 12 19 15 24 13 14 8 11
Question #4:
A disease detection model predicted 50 patients as positive. Out of these, 40 were actually positive.
What is the precision of the model?
SVM Notes:
This function is central to the process of training an SVM, as it encapsulates the goal of
maximizing the margin between classes while satisfying the classification constraints.
Understanding θ(α) in SVM
The SVM optimization problem can be approached via its dual formulation, which involves the
following objective function:
Where:
• αi are the Lagrange multipliers associated with each training example.
• yi are the class labels.
• xi are the feature vectors.
• K(xi,xj) is the kernel function, representing the inner product in the transformed feature
space.
The function θ(α) is the objective function that we aim to maximize in the dual problem. The
solution to this optimization problem yields the optimal values of αi , which in turn determine the
parameters of the optimal separating hyperplane.
Role of θ(α) in SVM Training
• Identifying Support Vectors: The training examples corresponding to non-zero αi
values are the support vectors. These are the critical points that lie closest to the decision
boundary and thus define the position and orientation of the hyperplane.
• Constructing the Decision Boundary: Once the optimal αi values are found by
maximizing θ(α), they are used to compute the weight vector w and bias b of the
hyperplane.
• Ensuring Maximum Margin: Maximizing θ(α) inherently leads to the hyperplane with
the maximum margin, which is the foundational principle of SVMs for achieving good
generalization on unseen data.
In summary, θ(α) serves as the dual objective function in SVMs, and its maximization is
crucial for determining the optimal hyperplane that separates the classes with the maximum
margin.