0% found this document useful (0 votes)
65 views

(A) Briefly Discuss The Polynomial Regression Model With Figure. Answer

The polynomial regression model approximates a complex nonlinear relationship by using a Taylor series expansion of the unknown nonlinear function. The K-nearest neighbors algorithm is a supervised machine learning algorithm that can be used for classification or regression. It works by finding the K closest training examples in the feature space and assigning a label based on the most common label of those K examples. The support vector machine aims to find the optimal separating hyperplane that maximizes the margin between the two classes. It uses support vectors, which are data points closest to the hyperplane, to define the position and orientation of the hyperplane.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views

(A) Briefly Discuss The Polynomial Regression Model With Figure. Answer

The polynomial regression model approximates a complex nonlinear relationship by using a Taylor series expansion of the unknown nonlinear function. The K-nearest neighbors algorithm is a supervised machine learning algorithm that can be used for classification or regression. It works by finding the K closest training examples in the feature space and assigning a label based on the most common label of those K examples. The support vector machine aims to find the optimal separating hyperplane that maximizes the margin between the two classes. It uses support vectors, which are data points closest to the hyperplane, to define the position and orientation of the hyperplane.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

3.(a)Briefly discuss the polynomial regression model with figure.

Answer:
The polynomial models can be used to approximate a complex nonlinear relationship. The
polynomial models is just the Taylor series expansion of the unknown nonlinear function in
such a case.

3.(b)Explain the working procedure of K-nearest neighbor (KNN) algorithm.


Answer:

K-nearest neighbors (KNN) algorithm is a type of supervised ML algorithm which can be used
for both classification as well as regression predictive problems. However, it is mainly used for
classification predictive problems in industry. The following two properties would define KNN
well −

 Lazy learning algorithm − KNN is a lazy learning algorithm because it does not have a
specialized training phase and uses all the data for training while classification.
 Non-parametric learning algorithm − KNN is also a non-parametric learning algorithm
because it doesn’t assume anything about the underlying data.

Working of KNN Algorithm

K-nearest neighbors (KNN) algorithm uses ‘feature similarity’ to predict the values of new
datapoints which further means that the new data point will be assigned a value based on how
closely it matches the points in the training set. We can understand its working with the help of
following steps −

Step 1 − For implementing any algorithm, we need dataset. So during the first step of KNN, we
must load the training as well as test data.

Step 2 − Next, we need to choose the value of K i.e. the nearest data points. K can be any
integer.

Step 3 − For each point in the test data do the following −

 3.1 − Calculate the distance between test data and each row of training data with the help
of any of the method namely: Euclidean, Manhattan or Hamming distance. The most
commonly used method to calculate distance is Euclidean.
 3.2 − Now, based on the distance value, sort them in ascending order.
 3.3 − Next, it will choose the top K rows from the sorted array.
 3.4 − Now, it will assign a class to the test point based on most frequent class of these
rows.

Step 4 − End

Example

The following is an example to understand the concept of K and working of KNN algorithm −

Suppose we have a dataset which can be plotted as follows −

Now, we need to classify new data point with black dot (at point 60,60) into blue or red class.
We are assuming K = 3 i.e. it would find three nearest data points. It is shown in the next
diagram −
We can see in the above diagram the three nearest neighbors of the data point with black dot.
Among those three, two of them lies in Red class hence the black dot will also be assigned in red
class.

3.(c) Calculate accuracy, precision, recall and F-measure for the above confusion matrix.

Answer:
4.(a) Support Vector Machine always tries to maintain maximum margin for
classification.Explain it with proper sketch.
Answer:
4.(b)Consider the following n=3 objects in a two dimensional space : S1(2,1) ,
S2(2,-1) and S3(4,0) ,where S1 and S2 are negative and S3 is positive class. In
addision,three support vectors are S1, S2 and S3. Apply support vector machine to
classify data objects and draw the hyperplane which separate both classes.
Answer:

You might also like