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

📄 getmccvdata.m

📁 轨迹聚类工具箱及其相关说明和文章(台风路径分类等)。如有问题可与wyljess@126.com联系
💻 M
字号:
function index = GetMccvData(Mccv,Run,NumTrajs,SetType)
%GetMccvData  Get the training/testing random data split.
%   Index = GetMccvData(Mccv,Run,NumTrajs,SetType) 
%
%   SetType:
%     'train'    : return training set indicies
%     'test'     : return testing set indicies
%     otherwise  : return full random index

% Scott J Gaffney   05 April 2002
% Department of Information and Computer Science
% University of California, Irvine.

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



%%% Handle Argument Processing
%%%
% Mccv = SetFieldDef(Mccv,'beta',Mccv.Beta);  % deal w/ capitalization error
%%%
%%% End Argument Processing

% Calculate sizes of training and testing sets
TestLen = floor(Mccv.SubsetSize * Mccv.beta);
TrainLen  = Mccv.SubsetSize - TestLen;

% Calculate Random Data Splits
tstate = rand('state');  % added 4 December 2002
NewState = AdvRandState(Mccv.State,NumTrajs,Run-1);

rand('state',NewState);
index = randperm(NumTrajs);
switch (SetType)
case 'test'
  index = index(TrainLen+1:Mccv.SubsetSize);
otherwise
  index = index(1:TrainLen);
end
rand('state', tstate);  % added 4 December 2002

⌨️ 快捷键说明

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