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

2022_Exam 1 Solution Source _2022

The document provides a solution to a classification problem using a Simple Bayesian Classifier, calculating probabilities for different classes based on given attributes. It also discusses methods for addressing zero-frequency problems, cross-validation, overfitting, linear regression, and support vector machines (SVM), with links to additional resources for each topic. The analysis concludes that the sample X is most likely classified as C1.

Uploaded by

gopisettypankaj
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)
5 views

2022_Exam 1 Solution Source _2022

The document provides a solution to a classification problem using a Simple Bayesian Classifier, calculating probabilities for different classes based on given attributes. It also discusses methods for addressing zero-frequency problems, cross-validation, overfitting, linear regression, and support vector machines (SVM), with links to additional resources for each topic. The analysis concludes that the sample X is most likely classified as C1.

Uploaded by

gopisettypankaj
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/ 6

Exam 1 Solution Source

Task1

X = {1,1,1, Class =?}

using Simple Bayssian Classifier

Sample Attribute1 Attribute2 Attribute3 Class


A1 A2 A3 C

1 1 2 1 1
2 0 0 1 1
3 2 1 2 2
4 1 2 1 2
5 0 1 2 1
6 2 2 2 2
7 1 0 1 1

We need to maximize the product P (X/Ci)  P (Ci), for i = 1,2

P(C=1) = 4/7 = 0.5714


P(C=2) = 3/7 = 0.4286

P(A1=1/C=1) = 2/4 = 0.5


P(A1=1/C=2) = 1/3 = 0.33
P(A2=1/C=1) = 1/4 = 0.25
P(A2=1/C=2) = 1/3 = 0.33
P(A3=1/C=1) = 3/4 = 0.75
P(A3=1/C=2) = 1/3 = 0.33

P (X / C=1) = P(A1=1/C=1) x P(A2=1/C=1) x P(A3=1/C=1)


= 0.50 x 0.25 x 0.75 = 0.09375

P (X / C=2) = P(A1=1/C=2) x P(A2=1/C=2) x P(A3=1/C=2)


= 0.33 x 0.33 x 0.33 = 0.035937

P (C1 / X) = P (X / C=1) x P(C=1) = 0.09375 x 0.5714 = 0.05356


P (C2 / X) = P (X / C=2) x P(C=2) = 0.035937 x 0.4286 = 0.01540

So the X will most likely be in C1

How to solve the zero-frequency problem in Naive Bayes?


https://www.atoti.io/how-to-solve-the-zero-frequency-problem-in-naive-bayes/

Task 2 Cross Validation


http://www2.stat.duke.edu/~rcs46/lectures_2017/05-resample/05-cv.pdf
https://HYPERLINK "https://rpubs.com/maulikpatel/226237"rpubs.comHYPERLINK
"https://rpubs.com/maulikpatel/226237"/HYPERLINK
"https://rpubs.com/maulikpatel/226237"maulikpatelHYPERLINK
"https://rpubs.com/maulikpatel/226237"/226237

Task 3 Overfitting
https://machinelearningmastery.com/overfitting-and-underfitting-with-machine-learning-
algorithms/
https://www.kdnuggets.com/2015/04/preventing-overfitting-neural-networks.html
https:// HYPERLINK
"https://msdn.microsoft.com/en-us/magazine/dn904675.aspx"msdn.microsoft.com HYPERLINK
"https://msdn.microsoft.com/en-us/magazine/dn904675.aspx"/ HYPERLINK
"https://msdn.microsoft.com/en-us/magazine/dn904675.aspx"en HYPERLINK
"https://msdn.microsoft.com/en-us/magazine/dn904675.aspx"-us/magazine/dn904675.aspx

Task 4 Linear Regression


https://towardsdatascience.com/implementation-linear-regression-in-python-in-5-minutes-from-
scratch-f111c8cc5c99
https://www.khanacademy.org/math/statistics-probability/describing-relationships-quantitative-
data/more-on-regression/v/regression-line-example

Task 5 SVM

http://mr-pc.org/t/cse5526/pdf/05c-svmKernels.pdf

https:// HYPERLINK "https://www.cs.utexas.edu/~dana/MLClass/XOR.pdf"www.cs.utexas.edu


HYPERLINK "https://www.cs.utexas.edu/~dana/MLClass/XOR.pdf"/~dana/ HYPERLINK
"https://www.cs.utexas.edu/~dana/MLClass/XOR.pdf"MLClass HYPERLINK
"https://www.cs.utexas.edu/~dana/MLClass/XOR.pdf"/ HYPERLINK
"https://www.cs.utexas.edu/~dana/MLClass/XOR.pdf"XOR.pdf

https://www.bogotobogo.com/python/scikit-learn/
scikit_machine_learning_Support_Vector_Machines_SVM_2.php#nonlinear-SVM-training
https://towardsdatascience.com/radial-basis-functions-neural-networks-all-we-need-to-know-
9a88cc053448

You might also like