📄 sgcsurface.m
字号:
function surfObj=sgcSurface(DS, pointNum, classParam)
if nargin<2, pointNum=100; end
if nargin<3
classWeight=getClassDataCount(DS); % classWeight (or priors) is equal to the data count of each class
classParam=sgcTrain(DS, classWeight);
end
% PDF for each class
x=linspace(min(DS.input(1,:)), max(DS.input(1,:)), pointNum);
y=linspace(min(DS.input(2,:)), max(DS.input(2,:)), pointNum);
[xx, yy] = meshgrid(x, y);
data = [xx(:), yy(:)]';
classNum=length(classParam);
for i=1:classNum
out = gaussian(data, classParam(i));
surfObj.class(i).surface = classParam(i).weight*reshape(out, pointNum, pointNum); % Multiplied by priors
surfObj.class(i).param = classParam(i);
end
surfObj.xx=xx;
surfObj.yy=yy;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -