ML QB
ML QB
ML QB
6. What are the performance measures to analyze the quality of the model?
Ans)The performance of a machine learning model can be evaluated using several
performance measures. The choice of performance measure depends on the problem
type and the goals of the model. Some common performance measures include:
● Recall: The ratio of true positives to the total number of actual positives. Recall
measures the model's ability to find all relevant instances.
● Mean Squared Error (MSE): The average squared difference between the
predicted and actual values. MSE is used for regression problems.
● Root Mean Squared Error (RMSE): The square root of the mean squared error.
RMSE is used for regression problems.
RSME= root of MSE
● Confusion Matrix: A matrix that summarizes the number of true positives, false
positives, true negatives, and false negatives. Confusion matrix is used to calculate
other performance measures such as accuracy, precision, recall, and F1-score.
Example: Suppose we see a strange cat that also has some features of dogs, so if we
want a model that can accurately identify whether it is a cat or dog, such a model can
be created by using the SVM algorithm. We will first train our model with lots of images
of cats and dogs so that it can learn about different features of cats and dogs, and then
we test it with this strange creature. So as the support vector creates a decision
boundary between these two data (cat and dog) and chooses extreme cases (support
vectors), it will see the extreme case of cat and dog. On the basis of the support
vectors, it will classify it as a cat or dog.
11. What is regularized regression?
Ans)
12. Explain the norm of a vector.
Ans) The length of the vector is referred to as the vector norm or the vector’s
magnitude.
The length of a vector is a nonnegative number that describes the extent of the vector in
space, and is sometimes referred to as the vector’s magnitude or the norm.
For example, we have vector v1=[-2,1]
Norm of a vector or L would be,
L=
The unsupervised learning algorithm can be further categorized into two types of
problems:
● Clustering: Clustering is a method of grouping the objects into clusters such that
objects with most similarities remain into a group and have less or no similarities
with the objects of another group.
15. Find vectors that are orthogonal to [1,2,3]. Explain why we can have an
infinite number of such vectors.
16. Explain least squares method for supervised machine learning technique.
Ans) Least-square method is the curve that best fits a set of observations with a
minimum sum of squared residuals or errors. Let us assume that the given points of
data are (x1, y1), (x2, y2), (x3, y3), …, (xn, yn) in which all x’s are independent
variables, while all y’s are dependent ones. This method is used to find a linear line of
the form y = mx + b, where y and x are variables, m is the slope, and b is the
y-intercept. The formula to calculate slope m and the value of b is given by:
m = (n∑xy - ∑y∑x)/n∑x2 - (∑x)2
b = (∑y - m∑x)/n
Here, n is the number of data points.
For example,
To illustrate, consider the case of an investor considering whether to invest in a gold
mining company. The investor might wish to know how sensitive the company’s stock
price is to changes in the market price of gold. To study this, the investor could use the
least squares method to trace the relationship between those two variables over time
onto a scatter plot. This analysis could help the investor predict the degree to which the
stock’s price would likely rise or fall for any given increase or decrease in the price of
gold.
Eigen Vector: