From 9bc46f01b5fe833503988f786690e36c57e7a2b1 Mon Sep 17 00:00:00 2001 From: "xuanyi.wang" Date: Mon, 22 May 2023 21:05:57 +0200 Subject: [PATCH] Update page 'Solutions to the questions concerning R language' --- ... to the questions concerning R language.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Solutions to the questions concerning R language.md b/Solutions to the questions concerning R language.md index b4d6716..f3039ce 100644 --- a/Solutions to the questions concerning R language.md +++ b/Solutions to the questions concerning R language.md @@ -425,3 +425,22 @@ Tuning reduces the training error to 15.12% and test error to 17.4% which is wor **viii.** Overall, radial basis kernel seems to be producing minimum misclassification error on both train and test data. + +***Conceptual Question*** +**i. ** +``` +x1 = c(3, 2, 4, 1, 2, 4, 4) +x2 = c(4, 2, 4, 4, 1, 3, 1) +colors = c("red", "red", "red", "red", "blue", "blue", "blue") +plot(x1, x2, col = colors, xlim = c(0, 5), ylim = c(0, 5)) +``` + +**ii.** + +The maximal margin classifier has to be in between observations #2, #3 and #5, #6. + +(2,2),(4,4) +(2,1),(4,3) +=>(2,1.5),(4,3.5) +b=(3.5−1.5)/(4−2)=1 +a=X2−X1=1.5−2=−0.5