Changeset 142 for prdatasets/pr_download_uci.m
- Timestamp:
- 01/05/20 23:22:59 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
prdatasets/pr_download_uci.m
r135 r142 78 78 79 79 %% if matfiles available, use them 80 [varargout{:}] = loadmatfile(comname);80 [varargout{:}] = pr_loadmatfile(comname); 81 81 if ~isempty(varargout{1}), return; end 82 82 … … 102 102 dataname = comname; 103 103 end 104 opt{j}.dsetname = dataname;104 % opt{j}.dsetname = dataname; 105 105 savemat = ~isfield(opt{j},'matfile') || opt{j}.matfile; 106 106 opt{j}.matfile = false; 107 opt{j}.delimeter= ','; 108 opt{j} = fielddef(opt{j},'dsetname',callername); 107 109 a = pr_download(data.url,fullfile(datadir,dataname),opt{j}); 108 110 a = setuser(a,data,'user'); % store dataset info 109 a = setname(a,dataname); % set dataset name111 % a = setname(a,dataname); % set dataset name 110 112 if ~isfield(opt{j},'labfeat') || isempty(opt{j}.labfeat) 111 113 a = feat2lab(a,size(a,2)); … … 120 122 if numel(ucinames) > 1 121 123 % multiple datasets loaded, alignment might be needed 122 [varargout{:}] = dset_align(varargout{:});124 [varargout{:}] = pr_dset_align(varargout{:}); 123 125 a = vertcat(varargout{:}); 124 126 a = setuser(a,data,'user'); % store dataset info 125 a = setname(a,comname); % set dataset name127 opt{end} = fielddef(opt{end},'dsetname',callername); 126 128 if ~isfield(opt{end},'matfile') || opt{end}.matfile 127 129 save(fullfile(datadir,comname),'a'); … … 167 169 dataname = prname; 168 170 end 169 filenames{j} = fullfile( thisdir,dataname);171 filenames{j} = fullfile(fullfile(thisdir,'data'),dataname); 170 172 if exist([filenames{j} '.mat'],'file') == 2 171 173 % if mat-file is available, use it … … 174 176 a = getfield(s,f{1}); 175 177 else 176 if ~exist('data' )178 if ~exist('data','var') 177 179 % get UCI info 178 180 data = parselink(name); … … 218 220 if anynew && numel(ucinames) > 1 219 221 % multiple datasets loaded, alignment might be needed 220 [varargout{:}] = dset_align(varargout{:});222 [varargout{:}] = pr_dset_align(varargout{:}); 221 223 for j=1:numel(ucinames) 222 224 a = varargout{j}; … … 273 275 data.type = type; 274 276 277 function s = fielddef(s,field,x) 278 if ~isfield(s,field) 279 s.(field) = x; 280 end 275 281 276 282 function name = callername(n)
Note: See TracChangeset
for help on using the changeset viewer.