You are on page 1of 5

MACHINE

LEARNING

ASSIGNMENT – II

NAME: Sree Aswin M


REG NO: 113220061012
YEAR & SEM :4TH &7TH
ROLL NO: 12
Gaussian Mixture Model
Problem:
We have a group of students here coming from either gifted class or regular
class. Students who had high score in last years’s exam were assigned to gifted
class and rest of the students were assigned to regular class. So the data is given
in form of table below.
Score Num
40 10
45 14
50 19
55 28
60 22
65 19
70 16
75 12
80 30
85 34
90 24
95 19
100 12
Solution:
Step1:
Initial split point =(40x10+45x14+…….+95x19+100x12)/(10+14+….+19+12)
= 71.62
Step2:
First Component:
Mean=(40x10+45x14+……..+65x19+70x16)/(10+14+…….+19+16)

M1=56.21 Score Num


Variance=(10x(40-56.21)^2+……..+16x(70-56.21)^2)/(10+…+16)-1 40 10
45 14
V1=78.64 50 19
55 28
60 22
65 19
70 16
75 12
Second component: 80 30
Mean=(75x12+…….+100x12)/(12+….+12) 85 34
90 24
M2=86.68 95 19
Variance=(12x(75-86.68)^2+…….+12x(100-86.68)^2)/(12+..+12)-1 100 12

V2=52.16
Since we have initialized the 3 parameters for 2 components,
Step3:
To Compute weight W1,
G(X|M1,V1)=((1/2pi|V1|)^0.5)exp(-0.5[X-M1]^T V1^-1[X-M1])

Substitue 40 45 50 55 60 65 70 75 80 85 90 95 100
G(X|M1,V1) 0.008 0.020 0.035 0.041 0.028 0.013 0.005 0.001 0 0 0 0 0

G(X|M2,V2)=((1/2pi|V2|)^0.5)exp(-0.5[X-M2]^T V1^-1[X-M2])
Substitue 40 45 50 55 60 65 70 75 80 85 90 95 100
G(X|M1,V1) 0 0 0 0 0 0.001 0.004 0.015 0.036 0.054 0.05 0.028 0.01

There for
𝑁
1 𝑊1.𝐺1(𝑋𝑛|𝑀1,𝑉1)
W1,new = ∑
𝑁 𝑛=1 ∑𝑤𝑘.𝐺(𝑋𝑛|𝑀𝑘,𝑉𝑘)

W1,new =0.494
𝑁
1 𝑊2.𝐺2(𝑋𝑛|𝑀2,𝑉2)
W2,new = ∑
𝑁 𝑛=1 ∑𝑤𝑘.𝐺(𝑋𝑛|𝑀𝑘,𝑉𝑘)

W2,new = 0.506

With the new W1 and W2 we will calculate the Mk,new


𝑛
𝑊2.𝐺2(𝑋𝑛|𝑀1,𝑉1)
∑ 𝑋𝑛 = 7728.26
𝑛=0 ∑𝑤𝑘.𝐺(𝑋𝑛|𝑀𝑘,𝑉𝑘)

𝑛
𝑊2.𝐺2(𝑋𝑛|𝑀1,𝑉1)
∑ =128.06
𝑛=0 ∑𝑤𝑘.𝐺(𝑋𝑛|𝑀𝑘,𝑉𝑘)

𝑛
𝑊2.𝐺2(𝑋𝑛|𝑀1,𝑉1)
∑ ∑𝑤𝑘.𝐺(𝑋𝑛|𝑀𝑘,𝑉𝑘) 7728.26
M1,new= 𝑛=0
𝑛 Xn = =55.45

𝑊2.𝐺2(𝑋𝑛|𝑀1,𝑉1) 128.06
𝑛=0∑𝑤𝑘.𝐺(𝑋𝑛|𝑀𝑘,𝑉𝑘)

Similarly M2,new is found =86.68


To find variance:

𝑛
𝑊2.𝐺2(𝑋𝑛|𝑀1, 𝑉1)
∑ (𝑋𝑛 − 𝑀1)^2=11006.97
𝑛=0 ∑𝑤𝑘.𝐺(𝑋𝑛|𝑀𝑘, 𝑉𝑘 )

𝑛
𝑊2.𝐺2(𝑋𝑛|𝑀1,𝑉1)
∑ =128.06
𝑛=0 ∑𝑤𝑘.𝐺(𝑋𝑛|𝑀𝑘,𝑉𝑘)

𝑛
𝑊2.𝐺2(𝑋𝑛|𝑀1,𝑉1)
∑ ∑𝑤𝑘.𝐺(𝑋𝑛|𝑀𝑘,𝑉𝑘) 11006.97
V1,new= 𝑛=0
𝑛 (Xn-Mk)^2= =85.95

𝑊2.𝐺2(𝑋𝑛|𝑀1,𝑉1) 128.06
𝑛=0∑𝑤𝑘.𝐺(𝑋𝑛|𝑀𝑘,𝑉𝑘)

V2,new is found in similar way = 52.16

Before we construct iteration:


W1=0.5 M1=56.21 V1=78.64
W2=0.5 M2=86.68 V2=52.16
After Step:
W1=0.49 M1=56.45 V1=85.95
W2=0.50 M2=86.46 V2=57.64

This iteration is done till there is no significant change in six


parameters.

Step 4:
The threshold can be found when the following requirement is fulfills
W1. G(X|M1,V1) = W2. G(X|M2,V2)
By solving the above equations we get
[V2-V1]X^2+2[V1M1-V2M2]+V2M1^2-V1M2^2-
2V1V2log[(W1(V2)^0.5)/ (W2(V1)^0.5)] = 0
By solving by quadratic equation formula we get
X=72.76 or 222.4
Hence X= 72.72 is within the range
So, any student with exam score less than 73 will be for regular class.

You might also like