ML-test - 16.11.2022

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Kongu Engineering College, Perundurai, Erode – 638060

Department of Computer Science and Engineering


20CST52 – Machine Learning

1. For the given chromosomes X1, X2, X3, X4 calculate the fitness value using fitness
function f(x) = a * ( 4 + b ) - ( 8 + c ) * ( 2 + d ) + e - 10

X1 = [a,b,c,d,e] = [16,15,13,11,6], X2 = [a,b,c,d,e] = [20,12,8,15,7]


X3 = [a,b,c,d,e] = [15,14,15,17,8], X4 = [a,b,c,d,e] = [18,15,13,16,9]

 Perform single point crossover operation with location as 2 between top two
chromosomes with highest fitness function to produce two new offspring.
 Perform two point crossover operations with location as 2 and 4 between two
chromosomes with lowest fitness function to produce two new offspring.
 Perform the uniform crossover operation with crossover mask [ 1, 0, 0, 1, 0 ] between
X1 and X3 to produce two new offspring.

2. Consider the following Reward table and construct the Q table with following actions
using γ = 0.7.
 C-D-B-F
 A-E-D-E-F
 B-D-E-F

3. Apply the K – Nearest Neighbour algorithm with K=1, K=3 and K=5 to following
instance and classify it.

Sepal Sepal Petal Petal Class


Length Width Length Width
7.4 0.27 3.19 0.49 ?

Use the following instances to classify the above instance

Sepal Sepal Petal Petal Class


Length Width Length Width
5.0 2.3 3.3 1.0 Iris_Versicolor
5.6 2.7 4.2 1.3 Iris_Versicolor
5.7 3.0 4.2 1.2 Iris_Versicolor
5.8 2.7 5.1 1.9 Iris_Virginica
6.3 2.9 5.6 1.8 Iris_Virginica
7.3 2.9 6.3 1.8 Iris_Versicolor
4. Apply K-medoids algorithm with initial centroids c1 = (9,6), c2 = (2,5), and c3 = (8,4) to
determine the object (3,8) as medoid of cluster . Use Euclidean distance measure.

X 9 10 4 5 3 2 8 4 8 9
Y 6 4 4 8 8 5 5 6 4 3

5. Apply Naïve Bayes algorithm for the following and determine the class for the given test
data.
Train data

Test data

6. Apply Naïve Bayes algorithm to classify the given text.

You might also like