Ignore:
Timestamp:
01/05/20 23:22:59 (5 years ago)
Author:
bduin
Message:

Updated collection of datasets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • prdatasets/pr_download_uci.m

    r135 r142  
    7878
    7979%% if matfiles available, use them
    80 [varargout{:}] = loadmatfile(comname);
     80[varargout{:}] = pr_loadmatfile(comname);
    8181if ~isempty(varargout{1}), return; end
    8282
     
    102102    dataname = comname;
    103103  end
    104   opt{j}.dsetname = dataname;
     104%   opt{j}.dsetname = dataname;
    105105  savemat = ~isfield(opt{j},'matfile') || opt{j}.matfile;
    106106  opt{j}.matfile  = false;
     107  opt{j}.delimeter= ',';
     108  opt{j} = fielddef(opt{j},'dsetname',callername);
    107109  a = pr_download(data.url,fullfile(datadir,dataname),opt{j});
    108110  a = setuser(a,data,'user'); % store dataset info
    109   a = setname(a,dataname);    % set dataset name
     111%   a = setname(a,dataname);    % set dataset name
    110112  if ~isfield(opt{j},'labfeat') || isempty(opt{j}.labfeat)
    111113    a = feat2lab(a,size(a,2));
     
    120122if numel(ucinames) > 1
    121123  % multiple datasets loaded, alignment might be needed
    122   [varargout{:}] = dset_align(varargout{:});
     124  [varargout{:}] = pr_dset_align(varargout{:});
    123125  a = vertcat(varargout{:});
    124126  a = setuser(a,data,'user'); % store dataset info
    125   a = setname(a,comname);    % set dataset name
     127  opt{end} = fielddef(opt{end},'dsetname',callername);
    126128  if ~isfield(opt{end},'matfile') || opt{end}.matfile
    127129    save(fullfile(datadir,comname),'a');
     
    167169    dataname = prname;
    168170  end
    169   filenames{j} = fullfile(thisdir,dataname);
     171  filenames{j} = fullfile(fullfile(thisdir,'data'),dataname);
    170172  if exist([filenames{j} '.mat'],'file') == 2
    171173    % if mat-file is available, use it
     
    174176    a = getfield(s,f{1});
    175177  else
    176     if ~exist('data')
     178    if ~exist('data','var')
    177179      % get UCI info
    178180      data = parselink(name);
     
    218220if anynew && numel(ucinames) > 1
    219221  % multiple datasets loaded, alignment might be needed
    220   [varargout{:}] = dset_align(varargout{:});
     222  [varargout{:}] = pr_dset_align(varargout{:});
    221223  for j=1:numel(ucinames)
    222224    a = varargout{j};
     
    273275data.type = type;
    274276
     277function s = fielddef(s,field,x)
     278  if ~isfield(s,field)
     279    s.(field) = x;
     280  end
    275281
    276282function name = callername(n)
Note: See TracChangeset for help on using the changeset viewer.