91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡(jiǎn)介

最簡(jiǎn)單的貝葉斯分類器演示Matlab程序。入門必備。 詳細(xì)請(qǐng)參考本人的博客http://blog.csdn.net/ranchlai/article/details/10375579

資源截圖

代碼片段和文件信息

%
%?Liscense?Notification?2013
%
%?Redistributions?in?source?and?binary?forms?with?or?without
%?modification?are?totally?FREE?provided?that?you?keep?this?keep?this
%?notification
%
%??Descritption:?This?package?demonstrates?the?discrete?adaboost?with
%??stump(decision?tree?with?only?the?root?node)?weak?classifers.
%??Author:??Ranch?Lai?(ranchlai@hotmail.com)
%??Release?date:?Aug?17?2013
%/
%%
clc;
clear;
close?all;


%%?generate?random?data
shift?=3.0;
n?=?2;%2?dim
%y?=?1./exp(-w‘*x+b)
sigma?=?1;
N?=?500;
x?=?[randn(nN/2)-shift?randn(nN/2)*sigma+shift];
y?=?[ones(N/21);-ones(N/21)];

%show?the?data
figure;
plot(x(11:N/2)x(21:N/2)‘rs‘);
hold?on;
plot(x(11+N/2:N)x(21+N/2:N)‘go‘);
title(‘2d?training?data‘);
legend(‘Positve?samples‘‘Negative?samples‘‘Location‘‘SouthEast‘);

%?model?fitting?using?maximum?likelihood
[model_posmodel_neg]?=?FindGuassianModel(xy);

%%?test?on?new?dataset?same?distribution

n?=?2;%2?dim
%y?=?1./exp(-w‘*x+b)
sigma?=?2;
N?=?500;
x?=?[randn(nN/2)-shift?randn(nN/2)*sigma+shift];
y?=?[ones(N/21);-ones(N/21)];

figure;
plot(x(11:N/2)x(21:N/2)‘rs‘);
hold?on;
plot(x(11+N/2:N)x(21+N/2:N)‘go‘);
title(‘2d?testing?data‘);
hold?on;

%%?gaussian?model?as?a?baseline
[errh]?=?FindModelError(model_posmodel_negxy);
fprintf(‘Baysian?error?on?test?data?set:?%f\n‘err/N);
x_pos?=?x(:h==1);
x_neg?=?x(:h~=1);
plot(x_pos(1:)x_pos(2:)‘r.‘);
hold?on;
plot(x_neg(1:)x_neg(2:)‘g.‘);
legend(‘Positve?samples‘‘Negative?samples‘‘Positve?samples?as?predicted‘‘Negative?samples?as?predicted‘‘Location‘‘SouthEast‘);


?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-08-27?03:07??Baysian+Gaussian\
?????文件????????8669??2013-08-27?03:07??Baysian+Gaussian\training.png
?????文件???????11809??2013-08-27?03:07??Baysian+Gaussian\predict.png
?????文件????????1583??2013-08-27?03:04??Baysian+Gaussian\demo_adaboost.m
?????文件?????????615??2013-08-26?09:43??Baysian+Gaussian\FindModelError.m
?????文件?????????401??2013-08-26?10:01??Baysian+Gaussian\FindGuassianModel.m

評(píng)論

共有 條評(píng)論