showmccv.m

来自「轨迹聚类工具箱及其相关说明和文章(台风路径分类等)。如有问题可与wyljess@」· M 代码 · 共 83 行

M
83
字号
function showmccv(mccv,Legend)
%SHOWMCCV  View MCCV clustering results
%   SHOWMCCV(mccv,[Legend])

% Scott J Gaffney   15 May 2001
% Department of Information and Computer Science
% University of California, Irvine.

PROGNAME = 'showmccv';
if (~nargin)
  try; help(PROGNAME); catch; end
  return;
end


ops.PlotLines = 0;
ops.PlotSymbols =1;
ops.symbolspec = '*';


if (exist('Legend')~=1 | isempty(Legend))
  no_legend = 1;
else
  no_legend = 0;
end

% calculate means and deviations
[mu,sigma] = mccv_like(mccv);
[muSSE,sigmaSSE] = mccv_SSE(mccv);

if (~isempty(mu))
  figure;
  orderHnd = [];
  K=mccv.Krange(:);
  Q = length(mccv.OrderRange);
  for q=1:Q
    spec = colorplot(q);
    spec = [spec(1), '-'];
    h = errorbar(K,mu(:,q),sigma(:,q),spec);
    set(h,'LineWidth',2);
    %h = colorplot(K,Pred_Error(:,i),i,ops);
    orderHnd(end+1) = h(1);
    hold on;
  end
  
  set(gca,'xtick',K);
  %set(gca,'xlim', [K(1)-1 K(end)+1]);
  title('MCCV Results');
  ylabel('Test log-likelihood');
  xlabel('Number of components');
  if (~no_legend)
    legend(orderHnd,Legend);
  end
end


if (~isempty(muSSE))
  figure;
  orderHnd = [];
  K=mccv.Krange(:);
  Q = length(mccv.OrderRange);
  for q=1:Q
    spec = colorplot(q);
    spec = [spec(1), '-'];
    h = errorbar(K,muSSE(:,q),sigmaSSE(:,q),spec);
    set(h,'LineWidth',2);
    %h = colorplot(K,Pred_Error(:,i),i,ops);
    orderHnd(end+1) = h(1);
    hold on;
  end
  
  set(gca,'xtick',K);
  %set(gca,'xlim', [K(1)-1 K(end)+1]);
  title('MCCV Results');
  ylabel('Test SSE');
  xlabel('Number of components');
  if (~no_legend)
    legend(orderHnd,Legend);
  end
end


⌨️ 快捷键说明

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