homework1_ZhankunLuo

This is Zhankun Luo's homework for Pattern Recognition course Fall 2018. It covers problem sets and experiments related to feature classification, Mahalanobis distance, and classifier performance. Key findings include the classification of a feature vector, drawing Mahalanobis distance curves, and analyzing the impact of varying class parameters on classifier errors." 111793236,10293401,DS18B20温度传感器操作指南:读取与转换温度数据,"['温度传感器', 'DS18B20', '单片机编程', '嵌入式开发', '硬件接口']
摘要由CSDN通过智能技术生成

Zhankun Luo

PUID: 0031195279

Email: luo333@pnw.edu

Fall-2018-ECE-59500-009

Instructor: Toma Hentea

Homework 1

Problem

Problem 2.7

(a) classify the feature vector [1.6; 1.5]
%% Problem 2.7 : calculate parameters
sigma = [1.2 0.4; 0.4 1.8];
mu1 = [0.1; 0.1];
mu2 = [2.1; 1.9];
mu3 = [-1.5; 1.9];
w1 = sigma \ mu1;
w2 = sigma \ mu2;
w3 = sigma \ mu3;
w10 = log(1/3) - 0.5 * mu1' * w1;
w20 = log(1/3) - 0.5 * mu2' * w2;
w30 = log(1/3) - 0.5 * mu3' * w3;

%% get exact value of g_i(x) of x
x = [1.6; 1.5];
g1 = w1' * x + w10
g2 = w2' * x + w20
g3 = w3' * x + w30
result
g1 =   -0.9321
g2 =    0.1279
g3 =   -4.4611
conclusion

g 2 ( x ) > g 1 ( x ) ; g 2 ( x ) > g 3 ( x ) g_2(x) > g_1(x) ; g_2(x) > g_3(x) g2(x)>g1(x);g2(x)>g3(x) ==> P ( ω 2 ∣ x ) > P ( ω 1 ∣ x ) , P ( ω 3 ∣ x ) P(\omega_2|x) > P(\omega_1|x), P(\omega_3|x) P(ω2x)>P(ω1x),P(ω3x)

Thus x x x belongs to the second class: x → ω 2 x \rightarrow \omega_2 xω2

(b) draw the curves of equal Mahalanobis distance from [2.1; 1.9]
%% Problem 2.7 (b)
%  draw the curves of equal Mahalanobis distance from [2.1; 1.9] 
x = -2:0.2:6;
y = -2:0.2:6;
mu = [2.1; 1.9];
sigma = [1.2 0.4; 0.4 1.8];
[X,Y] = meshgrid(x,y);
vector(:, :, 1) = X - mu(1) * ones(41, 41);
vector(:, :, 2) = Y - mu(2) * ones(41, 41);

for i = 1:41
    for j = 1:41
        temp = vector(i, j, :);
        Temp = reshape(temp, 2, 1);
        tempZ = sqrt(Temp' * (sigma \ Temp));
        Z(i, j) = tempZ;
    end
end
figure
contour(X, Y, Z, 'ShowText', 'on')

problem2_7_2
problem2_7_2

Curves of equal Mahalanobis distance from [2.1; 1.9]

Problem 2.8</

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值