⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example.m

📁 好东西啊 人脸识别用的 希望大家多支持这个
💻 M
字号:
clear all 
close all
load('../Data/ex4');

ind1 = find(y==1);
ind2 = find(y==-1);

figure
hold on
[N,junk]=size(X);
XX = 50:5:600
YY = -50:5:500;
[XXX,YYY]=meshgrid(XX,YY);
xxx= reshape(XXX,[length(XX)*length(XX),1]);
yyy= reshape(YYY,[length(YY)*length(YY),1]);
dataT = [xxx,yyy,ones(length(xxx),1)];
M=40
[fm1,fm2,line,alpha_ goodThresholds] = pkAdaBoost(X,y,M);
res = pkAdaClassify(dataT,fm1,fm2,line,alpha_,goodThresholds,M);

ii1 = find(res~=-1);
ii2 = find(res==-1);
plot(xxx(ii1),yyy(ii1),'.r',xxx(ii2),yyy(ii2),'.b','MarkerSize',10)
hold on 
%plot3(xxx(1:8:end),yyy(1:8:end),toto(1:8:end),'.');

plot(X(ind1,1),X(ind1,2),'.k','MarkerSize',15);
hold on
plot(X(ind2,1),X(ind2,2),'.g','MarkerSize',15);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -