• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 3 fuera de 23 páginas
Examen

COS4852 Assignment 3 Machine Learning Year Module 2026

Document preview thumbnail
Vista previa 3 fuera de 23 páginas

Get a clear, reliable assignment with accurate answers and useful explanations. Choose us to help you stay on track and work towards better results.

Vista previa del contenido

UNIVERSITY OF SOUTH AFRICA
College of Science, Engineering and Technology


⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄⋄


COS4852: Machine Learning

Assignment 3 | 2026, Year Module


⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄⋄




COS4852
Module Code:
Machine Learning
Module Name:
Assignment 3 – 2026
Assignment:
Year Module
Module Type:
500 (5 questions × 100 marks)
Total Marks:




Submitted in partial fulfilment of the requirements for Machine Learning, UNISA 2026

,UNISA | COS4852 Machine Learning – Assignment 3



Question 1: K-Nearest Neighbours Classification


1(a) Plotting the instances in the (x, y)-space


The ten labelled instances and the unknown instance V are summarised below.

Table 1: Instances plotted in the (x, y)-space
Instance x y Class
V −5.0 −5.0 Unknown
A1 4.0 4.0 A
A2 4.3 2.5 A
A3 6.5 3.0 A
A4 6.0 4.5 A
B1 7.5 8.5 B
B2 6.5 6.8 B
B3 7.5 6.0 B
B4 5.0 6.5 B
B5 6.7 5.0 B
C1 3.5 2.5 C


10 y
Class A
B1
Class B
8 Class C
B2
B4 V (unknown)
B3
6
B5
A4
A1
4
A3
C1 A2
2
x
−8 −6 −4 −2 2 4 6 8
−2

−4
V
−6

−8

Figure 1: Instances plotted in the (x, y)-space, annotated by class


The important spatial observation is that V lies far to the lower-left of every labelled instance.
Therefore the nearest neighbours are determined entirely by which labelled points lie closest to
(−5, −5).




Page 2 of 23

, UNISA | COS4852 Machine Learning – Assignment 3



1(b) KNN classification of V using the Euclidean distance, k = 5


The Euclidean distance between two points is

p
dE (V, P ) = (xP − xV )2 + (yP − yV )2 .


Since V = (−5, −5), this becomes

p
dE (V, P ) = (xP + 5)2 + (yP + 5)2 .




p √ √
dE (V, A1) = (4 + 5)2 + (4 + 5)2 =
81 + 81 = 162 = 12.728
p √ √
dE (V, A2) = (4.3 + 5)2 + (2.5 + 5)2 = 86.49 + 56.25 = 142.74 = 11.947
p √ √
dE (V, A3) = (6.5 + 5)2 + (3 + 5)2 = 132.25 + 64 = 196.25 = 14.009
p √ √
dE (V, A4) = (6 + 5)2 + (4.5 + 5)2 = 121 + 90.25 = 211.25 = 14.534
p √ √
dE (V, B1) = (7.5 + 5)2 + (8.5 + 5)2 = 156.25 + 182.25 = 338.5 = 18.398
p √ √
dE (V, B2) = (6.5 + 5)2 + (6.8 + 5)2 = 132.25 + 139.24 = 271.49 = 16.477
p √ √
dE (V, B3) = (7.5 + 5)2 + (6 + 5)2 = 156.25 + 121 = 277.25 = 16.651
p √ √
dE (V, B4) = (5 + 5)2 + (6.5 + 5)2 = 100 + 132.25 = 232.25 = 15.240
p √ √
dE (V, B5) = (6.7 + 5)2 + (5 + 5)2 = 136.89 + 100 = 236.89 = 15.391
p √ √
dE (V, C1) = (3.5 + 5)2 + (2.5 + 5)2 = 72.25 + 56.25 = 128.5 = 11.336



Table 2: Euclidean distances from V , ascending order
Rank Instance (Class) Distance
1 C1 (C) 11.336
2 A2 (A) 11.947
3 A1 (A) 12.728
4 A3 (A) 14.009
5 A4 (A) 14.534
6 B4 (B) 15.240
7 B5 (B) 15.391
8 B2 (B) 16.477
9 B3 (B) 16.651
10 B1 (B) 18.398

For k = 5 the five nearest neighbours are C1, A2, A1, A3, A4, with classes C, A, A, A, A.
Counting the votes gives A = 4, B = 0, C = 1. Class A has the majority, so


V = Class A

Page 3 of 23

Libro relacionado
 image
Peter Flach Machine Learning
Editorial: 2012-09-20 ISBN: 9781107422223 Edición: 1

Información del documento

Subido en
29 de julio de 2026
Número de páginas
23
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$21.91

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
BeeNotes
4.1
(40)
Vendido
352
Seguidores
0
Artículos
1012
Última venta
1 semana hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes