Changeset 79
- Timestamp:
- 07/23/13 12:22:18 (11 years ago)
- Location:
- distools
- Files:
-
- 52 edited
Legend:
- Unmodified
- Added
- Removed
-
distools/aucdlpc.m
r10 r79 43 43 44 44 if nargin < 1 | isempty(d) 45 w = mapping(mfilename,C);45 w = prmapping(mfilename,C); 46 46 w = setname(w,'AUCDLPC'); 47 47 return -
distools/augpsem.m
r10 r79 67 67 if nargin < 2 | isempty(alf), alf = inf; end 68 68 if nargin < 1 | isempty(d) 69 W = mapping(mfilename,alf,pzero);69 W = prmapping(mfilename,alf,pzero); 70 70 W = setname(W,'Augmented PE embedding'); 71 71 return … … 196 196 %%%%% ---------------------------------------------- %%%%% 197 197 198 W = mapping(mfilename,'trained',{Wp,Wn,dme,pzero,tsig,sig,tol},[],m,sum(sig));198 W = prmapping(mfilename,'trained',{Wp,Wn,dme,pzero,tsig,sig,tol},[],m,sum(sig)); 199 199 W = setname(W,'Augmented PE embedding'); 200 200 return -
distools/checkeucl.m
r10 r79 49 49 end 50 50 51 D = dataset(D,1); % we are not interested in labels here.51 D = prdataset(D,1); % we are not interested in labels here. 52 52 D = setfeatlab(D,ones(m,1)); 53 53 -
distools/checksubeucl.m
r10 r79 20 20 discheck(d) 21 21 m = size(d,1); 22 d = dataset(+d,1);22 d = prdataset(+d,1); 23 23 d = setfeatlab(d,ones(m,1)); 24 24 -
distools/corrdistm.m
r10 r79 10 10 % 11 11 % OUTPUT 12 % D NxM dissimilarity matrix or dataset; D in [0,1]12 % D NxM dissimilarity matrix or prdataset; D in [0,1] 13 13 % 14 14 % DESCRIPTION -
distools/cosdistm.m
r10 r79 10 10 % 11 11 % OUTPUT 12 % D NxM Dissimilarity matrix or dataset; D in [0,1]12 % D NxM Dissimilarity matrix or prdataset; D in [0,1] 13 13 % 14 14 % DESCRIPTION -
distools/discc.m
r10 r79 34 34 if nargin < 1 | isempty(d) 35 35 if isstr(par) % untrained classifier, par = 'loo' or 'all' 36 W = mapping('discc',par);36 W = prmapping('discc',par); 37 37 else % fixed classifier, par = knn 38 W = mapping('discc','fixed',par);38 W = prmapping('discc','fixed',par); 39 39 end 40 40 return 41 41 end 42 42 43 [nlab,lablist,m,k,c,p,featlist] = dataset(d);43 [nlab,lablist,m,k,c,p,featlist] = prdataset(d); 44 44 [clab,classlist] = renumlab(featlist); 45 45 c = size(classlist,1); … … 78 78 K = K+k; 79 79 end 80 w = +( dataset(s,2-(t==r))*loglc);81 W = mapping('discc',w,lablist,k,c,1);80 w = +(prdataset(s,2-(t==r))*loglc); 81 W = prmapping('discc',w,lablist,k,c,1); 82 82 elseif strcmp(par,'all') 83 83 n = m*k; … … 92 92 K = K+k; 93 93 end 94 w = +( dataset(s,2-(t==r))*loglc);95 W = mapping('discc',w,lablist,k,c,1);94 w = +(prdataset(s,2-(t==r))*loglc); 95 W = prmapping('discc',w,lablist,k,c,1); 96 96 else 97 97 error(['Unknown option ''' par '''']) … … 102 102 % testing for given mapping 103 103 104 if isa(par,' mapping')104 if isa(par,'prmapping') 105 105 w = +par; 106 106 W = d*w(1) + w(2); -
distools/disnorm.m
r18 r79 35 35 36 36 if nargin == 0 | isempty(D) 37 V = mapping(mfilename,{opt});37 V = prmapping(mfilename,{opt}); 38 38 V = setname(V,'Disnorm'); 39 39 return … … 41 41 42 42 if ~isdataset(D) 43 D = dataset(D,1);43 D = prdataset(D,1); 44 44 D = setfeatlab(D,getlabels(D)); 45 45 end … … 60 60 D = D./m; 61 61 end 62 V = mapping(mfilename,'trained',{m},[],size(D,2),size(D,2));62 V = prmapping(mfilename,'trained',{m},[],size(D,2),size(D,2)); 63 63 return; 64 64 end -
distools/dispc.m
r10 r79 15 15 16 16 if nargin < 1 | isempty(a) % empty call (untrained classifier) 17 w = mapping('dispc');17 w = prmapping('dispc'); 18 18 19 19 elseif nargin == 1 % training 20 [nlab,lablist,m,k,c,p] = dataset(a);20 [nlab,lablist,m,k,c,p] = prdataset(a); 21 21 [nn,nf,fl] = renumlab(lablist,getfeat(a)); 22 22 if c < 2 … … 37 37 38 38 b = {+a(find(nlab==nf(j)),j) +a(find(nlab~=nf(j)),j)}; 39 w = [w; mapping('distrc',b,fl(nf(j),:),1,1,1)];39 w = [w; prmapping('distrc',b,fl(nf(j),:),1,1,1)]; 40 40 end 41 41 … … 54 54 w2(R2(L2)-n2) = (n2+2-(L2-[1:m]'))/(n2+2); 55 55 % disp([w1;w2]) 56 w = invsig( dataset((w1+w2)/2,getlab(a),getfeat(v)));56 w = invsig(prdataset((w1+w2)/2,getlab(a),getfeat(v))); 57 57 else 58 58 error('Illegal call') -
distools/disrc.m
r10 r79 29 29 30 30 if nargin < 1 | isempty(a) % empty call (untrained classifier) 31 w = mapping('disrc');31 w = prmapping('disrc'); 32 32 33 33 elseif nargin == 1 % training 34 [nlab,lablist,m,k,c,p] = dataset(a);34 [nlab,lablist,m,k,c,p] = prdataset(a); 35 35 [nn,nf,fl] = renumlab(lablist,getfeat(a)); 36 36 if c < 2 … … 43 43 for j = 1:k 44 44 b = {+a(find(nlab==nf(j)),j) +a(find(nlab~=nf(j)),j)}; 45 w = [w; mapping('disrc',b,fl(nf(j),:),1,1,1)];45 w = [w; prmapping('disrc',b,fl(nf(j),:),1,1,1)]; 46 46 end 47 47 … … 60 60 w2(R2(L2)-n2) = (n2+2-(L2-[1:m]'))/(n2+2); 61 61 % disp([w1;w2]) 62 w = invsig( dataset((w1+w2)/2,getlab(a),getfeat(v)));62 w = invsig(prdataset((w1+w2)/2,getlab(a),getfeat(v))); 63 63 else 64 64 error('Illegal call') -
distools/dissimt.m
r10 r79 58 58 end 59 59 if nargin == 0 | isempty(D) 60 W = mapping(mfilename,'fixed',{type,p});60 W = prmapping(mfilename,'fixed',{type,p}); 61 61 W = setname(W,'Fixed proximity transformation'); 62 62 return -
distools/dlpc.m
r10 r79 25 25 % W1 LP-Classifier in the complete dissimilarity space 26 26 % W2 LP-Classifier in a reduced dissimilarity space 27 % W3 Object selection mapping; the indices of support objects are in +W3.27 % W3 Object selection prmapping; the indices of support objects are in +W3. 28 28 % 29 29 % DEFAULTS … … 125 125 if nargin < 2 | isempty(is_w0), is_w0 = 1; end 126 126 if nargin < 1 | isempty(d) 127 W1 = mapping(mfilename,{is_w0,type,par,usematlab});127 W1 = prmapping(mfilename,{is_w0,type,par,usematlab}); 128 128 W1 = setname(W1,'DLPC'); 129 129 W2 = []; … … 176 176 % If more than 2 classes, do one against all others. 177 177 if C > 2, 178 % W1 = mclassc(d, mapping(mfilename,{is_w0,type,par,usematlab}));178 % W1 = mclassc(d,prmapping(mfilename,{is_w0,type,par,usematlab})); 179 179 180 180 W1 = []; -
distools/dmstspm.m
r10 r79 43 43 end 44 44 if nargin < 1 | isempty(D) 45 W = mapping(mfilename,{K,p});45 W = prmapping(mfilename,{K,p}); 46 46 W = setname(W,'dmstspm'); 47 47 return … … 140 140 141 141 [Lmst,d] = kdmst(D,K,p); 142 W = mapping(mfilename,'trained',{Lmst,d,K},[],n,n);142 W = prmapping(mfilename,'trained',{Lmst,d,K},[],n,n); 143 143 W = setname(W,'dmstspm'); 144 144 end -
distools/dprocrustdm.m
r10 r79 54 54 % 55 55 % SEE ALSO 56 % MDS, PCA , PSEM, KPCA, MAPPINGS, DATASETS56 % MDS, PCAM, PSEM, KPCA, MAPPINGS, DATASETS 57 57 % 58 58 % REFERENCE -
distools/drsscc.m
r10 r79 44 44 end 45 45 if nargin < 1 | isempty(D) 46 W = mapping('DRSSCC',{v,N,M,crule});46 W = prmapping('DRSSCC',{v,N,M,crule}); 47 47 return 48 48 end -
distools/expdistm.m
r10 r79 64 64 end 65 65 66 isda = isa(A,' dataset');67 isdb = isa(B,' dataset');66 isda = isa(A,'prdataset'); 67 isdb = isa(B,'prdataset'); 68 68 a = +A; 69 69 b = +B; -
distools/fastmapd.m
r10 r79 40 40 end 41 41 if nargin < 1 | isempty(D) 42 W = mapping(mfilename,K);42 W = prmapping(mfilename,K); 43 43 W = setname(W,'Fastmapd'); 44 44 return … … 66 66 end 67 67 end 68 W = dataset(Y,nlab);68 W = prdataset(Y,nlab); 69 69 return 70 70 end … … 133 133 end 134 134 135 W = mapping(mfilename,'trained',{P,dd,X,KK},[],n,KK);135 W = prmapping(mfilename,'trained',{P,dd,X,KK},[],n,KK); 136 136 W = setname(W,'Fastmapd'); 137 137 return -
distools/genballd.m
r10 r79 45 45 46 46 labs = genlab(n); 47 d = dataset(d,labs);47 d = prdataset(d,labs); 48 48 d = setfeatlab(d,labs); 49 49 d = setprior(d,0); -
distools/genddat.m
r28 r79 100 100 end 101 101 102 [ja,jb] = gendat( dataset([1:n]',nlab),m);102 [ja,jb] = gendat(prdataset([1:n]',nlab),m); 103 103 ja = +ja; 104 104 jb = +jb; -
distools/genrep.m
r10 r79 86 86 L = [R; setdiff(L,R)]; 87 87 end 88 DR = dataset(D(L,R),labels(L,:),'featlab',labels(R,:));88 DR = prdataset(D(L,R),labels(L,:),'featlab',labels(R,:)); 89 89 else 90 90 if strcmp(strl,'exclude') … … 96 96 ; 97 97 end 98 DR = dataset(D(L,R),labels(L,:),'featlab',labels(R,:));99 DT = dataset(D(T,R),labels(T,:),'featlab',labels(R,:));98 DR = prdataset(D(L,R),labels(L,:),'featlab',labels(R,:)); 99 DT = prdataset(D(T,R),labels(T,:),'featlab',labels(R,:)); 100 100 end 101 101 return -
distools/ikfd.m
r10 r79 43 43 end 44 44 if nargin < 1 | isempty(K), 45 W = mapping(mfilename,{alf,isb0});45 W = prmapping(mfilename,{alf,isb0}); 46 46 W = setname(W,'IKFD'); 47 47 return -
distools/ikpca.m
r10 r79 44 44 % 45 45 % SEE ALSO 46 % MAPPINGS, DATASETS, PCA , PSEM46 % MAPPINGS, DATASETS, PCAM, PSEM 47 47 % 48 48 % REFERENCE … … 71 71 end 72 72 if nargin < 1 | isempty(K), 73 W = mapping(mfilename,alf,prec);73 W = prmapping(mfilename,alf,prec); 74 74 W = setname(W,'IKPCA'); 75 75 return … … 117 117 L = L(J); % Eigenvalues 118 118 119 W = mapping(mfilename,'trained',{QL,pars{2},L,sig,pars{5}},[],m,length(J));119 W = prmapping(mfilename,'trained',{QL,pars{2},L,sig,pars{5}},[],m,length(J)); 120 120 W = setname(W,'IKPCA'); 121 121 return … … 173 173 174 174 % Determine the mapping 175 W = mapping(mfilename,'trained',{QL,Kme,L,sig,prec},[],m,sum(sig));175 W = prmapping(mfilename,'trained',{QL,Kme,L,sig,prec},[],m,sum(sig)); 176 176 W = setname(W,'IKPCA'); 177 177 return -
distools/ispe_em.m
r10 r79 22 22 prtrace(mfilename); 23 23 24 if isa(w,' mapping') & strcmp(w.mapping_file,'pe_em')24 if isa(w,'prmapping') & strcmp(w.mapping_file,'pe_em') 25 25 n = 1; 26 26 else -
distools/ispsem.m
r10 r79 22 22 prtrace(mfilename); 23 23 24 if isa(w,' mapping') & strcmp(w.mapping_file,'psem')24 if isa(w,'prmapping') & strcmp(w.mapping_file,'psem') 25 25 n = 1; 26 26 else -
distools/jacsimdistm.m
r10 r79 10 10 % 11 11 % OUTPUT 12 % D NxM Dissimilarity matrix or dataset; D in [0,1]12 % D NxM Dissimilarity matrix or prdataset; D in [0,1] 13 13 % 14 14 % DESCRIPTION -
distools/kcenterm.m
r10 r79 39 39 40 40 if nargin < 1 | isempty(K) 41 V = mapping(mfilename);41 V = prmapping(mfilename); 42 42 V = setname(V,'kcenterm'); 43 43 return … … 101 101 end 102 102 103 V = mapping(mfilename,'trained',{v,Kwm},[],m,m);103 V = prmapping(mfilename,'trained',{v,Kwm},[],m,m); 104 104 V = setname(V,'kcenterm'); 105 105 return -
distools/kem.m
r18 r79 47 47 % 48 48 % SEE ALSO 49 % MAPPINGS, DATASETS, PE_EM, AUGPSEM, PCA , PE_PCA, PE_SPEC, GETSIG, SETSIG49 % MAPPINGS, DATASETS, PE_EM, AUGPSEM, PCAM, PE_PCA, PE_SPEC, GETSIG, SETSIG 50 50 % 51 51 % LITERATURE … … 73 73 74 74 if nargin < 1 | isempty(d), 75 W = mapping(mfilename,{alf,pzero,prec});75 W = prmapping(mfilename,{alf,pzero,prec}); 76 76 W = setname(W,'PE embedding'); 77 77 return … … 146 146 data.eval = L(J); % Eigenvalues 147 147 148 W = mapping(mfilename,'trained',data,[],m,length(J));148 W = prmapping(mfilename,'trained',data,[],m,length(J)); 149 149 W = setname(W,'PE embedding'); 150 150 return … … 204 204 % Determine the mapping depending on pzero 205 205 if pzero == 0, 206 W = mapping(mfilename,'trained',data,[],m,sum(sig));206 W = prmapping(mfilename,'trained',data,[],m,sum(sig)); 207 207 else 208 208 data.mdis = +d(:,pzero)'; 209 W = mapping(mfilename,'trained',data,[],m,sum(sig));209 W = prmapping(mfilename,'trained',data,[],m,sum(sig)); 210 210 end 211 211 W = setname(W,'PE embedding'); -
distools/kfd.m
r10 r79 43 43 end 44 44 if nargin < 1 | isempty(K), 45 W = mapping(mfilename,{alf,isb0});45 W = prmapping(mfilename,{alf,isb0}); 46 46 W = setname(W,'KFD'); 47 47 return -
distools/knndc.m
r10 r79 59 59 % empty call, to handle d*knnd, or d*knnd([],par) 60 60 if nargin < 1 | isempty(d) 61 W = mapping(mfilename,'untrained',knn,par);61 W = prmapping(mfilename,'untrained',knn,par); 62 62 W = setname(W,'KNND'); 63 63 return … … 70 70 p = getprior(d); 71 71 72 %[nlab,lablist,m,k,c,p,featlist] = dataset(d);72 %[nlab,lablist,m,k,c,p,featlist] = prdataset(d); 73 73 [clab,classlist] = renumlab(featlist); 74 74 [cl,nc] = renumlab(classlist,lablist); … … 131 131 end 132 132 133 W = mapping(mfilename,'trained',{knn,JJ},lablist,k,c);133 W = prmapping(mfilename,'trained',{knn,JJ},lablist,k,c); 134 134 W = setname(W,'KNNDC'); 135 135 -
distools/kpca.m
r10 r79 31 31 % 32 32 % SEE ALSO 33 % MAPPINGS, DATASETS, PCA , PSEM33 % MAPPINGS, DATASETS, PCAM, PSEM 34 34 % 35 35 % REFERENCE … … 48 48 end 49 49 if nargin < 1 | isempty(K), 50 W = mapping(mfilename,alf);50 W = prmapping(mfilename,alf); 51 51 W = setname(W,'Kernel PCA'); 52 52 return … … 100 100 L = L(J); % Eigenvalues 101 101 102 W = mapping(mfilename,'trained',{Q,pars{2},L},[],m,length(J));102 W = prmapping(mfilename,'trained',{Q,pars{2},L},[],m,length(J)); 103 103 W = setname(W,'KPCA'); 104 104 return … … 154 154 155 155 % Determine the mapping 156 W = mapping(mfilename,'trained',{Q,Kme,L},[],m,length(J));156 W = prmapping(mfilename,'trained',{Q,Kme,L},[],m,length(J)); 157 157 W = setname(W,'KPCA'); 158 158 return -
distools/ksvc.m
r10 r79 95 95 end 96 96 if nargin < 1 | isempty(K), 97 W = mapping(mfilename,{C,kc,r});97 W = prmapping(mfilename,{C,kc,r}); 98 98 W = setname(W,'Kernel Support Vector Classifier (KSVC)'); 99 99 return; … … 115 115 116 116 % TRAIN THE CLASSIFIER 117 if ~isa(C,' mapping')117 if ~isa(C,'prmapping') 118 118 islabtype(K,'crisp'); 119 119 isvaldset(K,1,2); % Expect at least 1 object per class and 2 classes … … 167 167 168 168 % Store the results 169 W = mapping(mfilename,'trained',{me,J,T,v,reg},getlablist(K),k,2);169 W = prmapping(mfilename,'trained',{me,J,T,v,reg},getlablist(K),k,2); 170 170 % W = cnormc(W,K); 171 171 W = setname(W,'Kernel Support Vector Classifier (KSVC)'); -
distools/ksvc_nu.m
r10 r79 113 113 end 114 114 if nargin < 1 | isempty(K), 115 W = mapping(mfilename,{nu,kc,r});115 W = prmapping(mfilename,{nu,kc,r}); 116 116 W = setname(W,'Kernel Support Vector Classifier (KSVC-NU)'); 117 117 return; … … 134 134 135 135 % TRAIN THE CLASSIFIER 136 if ~isa(nu,' mapping')136 if ~isa(nu,'prmapping') 137 137 islabtype(K,'crisp'); 138 138 isvaldset(K,1,2); % Expect at least 1 object per class and 2 classes … … 187 187 188 188 % Store the results 189 W = mapping(mfilename,'trained',{me,J,T,v},getlablist(K),k,2);189 W = prmapping(mfilename,'trained',{me,J,T,v},getlablist(K),k,2); 190 190 %W = cnormc(W,a); 191 191 W = setname(W,'Kernel Support Vector Classifier (KSVC-NU)'); -
distools/mclassdc.m
r10 r79 50 50 end 51 51 if nargin < 1 | isempty(D) 52 w = mapping(mfilename,{classf,mode});52 w = prmapping(mfilename,{classf,mode}); 53 53 return 54 54 end … … 65 65 varout = {}; 66 66 if c == 2 67 varargout = map(D,classf);67 varargout = prmap(D,classf); 68 68 return 69 69 end … … 82 82 Dtargets = gettargets(D); 83 83 targets = [Dtargets(:,i) 1-Dtargets(:,i)]; 84 DD = dataset(+D,mlab,targets,'lablist',[1 2]');84 DD = prdataset(+D,mlab,targets,'lablist',[1 2]'); 85 85 end 86 86 if nargout(classf.mapping_file) > 1 87 [v,varo] = map(DD,classf);87 [v,varo] = prmap(DD,classf); 88 88 varout = [varout {varo}]; 89 89 else 90 v = map(DD,classf);90 v = prmap(DD,classf); 91 91 end 92 92 w = [w,setlabels(v(:,1),lablist(i,:))]; … … 114 114 I1 = setdiff([1:c],z); 115 115 if nargout(classf.mapping_file) > 1 116 [v,varo] = map(DD,classf);116 [v,varo] = prmap(DD,classf); 117 117 varout = [varout {varo}]; 118 118 else 119 v = map(DD,classf);119 v = prmap(DD,classf); 120 120 end 121 121 w = [w,setlabels(v(:,1),lab)]; -
distools/parzenddc.m
r18 r79 29 29 % No input arguments: return an untrained mapping. 30 30 if nargin == 0 | isempty(d) 31 W = mapping(mfilename,h);31 W = prmapping(mfilename,h); 32 32 W = setname(W,'Parzen DisRep Classifier'); 33 33 return; … … 146 146 par.weights = ones(m,1); 147 147 148 W = mapping('parzend_map','trained',par,getlablist(d),k,c);148 W = prmapping('parzend_map','trained',par,getlablist(d),k,c); 149 149 W = setname(W,'Parzen DisRep Classifier'); 150 150 W = setcost(W,d); -
distools/pe_affine.m
r10 r79 18 18 par.map = arg1; 19 19 par.sig = arg2; 20 argout = mapping(mfilename,'trained',par,getlabels(arg1),n1,n2);20 argout = prmapping(mfilename,'trained',par,getlabels(arg1),n1,n2); 21 21 else 22 22 isdataset(arg1); -
distools/pe_distm.m
r10 r79 32 32 % 33 33 % SEE ALSO 34 % DATASET, SETSIG, DISTM34 % PRDATASET, SETSIG, DISTM 35 35 36 36 % Copyright: Elzbieta Pekalska, ela.pekalska@googlemail.com … … 47 47 sig = getsig(A); 48 48 49 if ~isdataset(B), B = dataset(B,1); end49 if ~isdataset(B), B = prdataset(B,1); end 50 50 51 51 a = +A; -
distools/pe_em.m
r28 r79 43 43 % 44 44 % SEE ALSO 45 % MAPPINGS, DATASETS, AUGPSEM, PCA , GETSIG, SETSIG45 % MAPPINGS, DATASETS, AUGPSEM, PCAM, GETSIG, SETSIG 46 46 % 47 47 % LITERATURE … … 70 70 71 71 if nargin < 1 | isempty(d), 72 W = mapping(mfilename,{alf,pzero,prec});72 W = prmapping(mfilename,{alf,pzero,prec}); 73 73 W = setname(W,'PE embedding'); 74 74 return … … 143 143 data.eval = L(J); % Eigenvalues 144 144 145 W = mapping(mfilename,'trained',data,[],m,length(J));145 W = prmapping(mfilename,'trained',data,[],m,length(J)); 146 146 W = setname(W,'PE embedding'); 147 147 return … … 200 200 % Determine the mapping depending on pzero 201 201 if pzero == 0, 202 W = mapping(mfilename,'trained',data,[],m,sum(sig));202 W = prmapping(mfilename,'trained',data,[],m,sum(sig)); 203 203 else 204 204 data.mdis = +d(:,pzero)'; 205 W = mapping(mfilename,'trained',data,[],m,sum(sig));205 W = prmapping(mfilename,'trained',data,[],m,sum(sig)); 206 206 end 207 207 W = setname(W,'PE embedding'); -
distools/pe_kernelm.m
r10 r79 53 53 if (nargin < 1) | (isempty(a) & nargin == 1) 54 54 % Definition: pe kernel mapping. 55 w = mapping(mfilename,{b});55 w = prmapping(mfilename,{b}); 56 56 w = setname(w,mapname); 57 57 elseif isempty(a) 58 w = mapping(mfilename,'trained',b,getlab(b),size(b,2),size(b,1));58 w = prmapping(mfilename,'trained',b,getlab(b),size(b,2),size(b,1)); 59 59 w = setname(w,mapname); 60 60 elseif isdataset(a) & ~isempty(a) 61 61 if isempty(b) % store a as rep set, 'training' 62 w = mapping(mfilename,'trained',a,getlab(a),size(a,2),size(a,1));62 w = prmapping(mfilename,'trained',a,getlab(a),size(a,2),size(a,1)); 63 63 w = setname(w,mapname); 64 64 elseif isdataset(b); % compute kernel between a and b … … 66 66 elseif ismapping(b) 67 67 if isuntrained(b) % nothing stored yet, do it now, a is rep set 68 w = mapping(mfilename,'trained',a,getlab(a),size(a,2),size(a,1));68 w = prmapping(mfilename,'trained',a,getlab(a),size(a,2),size(a,1)); 69 69 w = setname(w,mapname); 70 70 else % we have already a rep set: compute kernel matrix … … 77 77 78 78 else % may be double ??? 79 a = dataset(a);79 a = prdataset(a); 80 80 w = feval(mfilename,a,b); 81 81 -
distools/pe_knnc.m
r10 r79 31 31 32 32 if nargin == 0 | isempty(a) 33 w = mapping(mfilename,'untrained',{k});33 w = prmapping(mfilename,'untrained',{k}); 34 34 w = setname(w,'PE K-NN Classifier'); 35 35 … … 45 45 e = testkd(pe_distm(a),k,'loo'); 46 46 end 47 w = mapping(mfilename,'trained',{a,k},getlablist(a),size(a,2),getsize(a,3));47 w = prmapping(mfilename,'trained',{a,k},getlablist(a),size(a,2),getsize(a,3)); 48 48 end 49 49 -
distools/pe_libsvc.m
r10 r79 42 42 43 43 if nargin == 0 | isempty(a) 44 w = mapping(mfilename,'untrained',{c});44 w = prmapping(mfilename,'untrained',{c}); 45 45 w = setname(w,'PE LIBSVC'); 46 46 … … 53 53 ktrain = pe_kernelm(a,a) 54 54 v = libsvc(ktrain,0); 55 w = mapping(mfilename,'trained',{v,a},getlablist(a),size(a,2),getsize(a,3));55 w = prmapping(mfilename,'trained',{v,a},getlablist(a),size(a,2),getsize(a,3)); 56 56 end 57 57 -
distools/pe_nmc.m
r10 r79 24 24 25 25 if nargin == 0 | isempty(a) 26 w = mapping(mfilename,'untrained');26 w = prmapping(mfilename,'untrained'); 27 27 w = setname(w,'PE Nearest Mean'); 28 28 -
distools/pe_parzenc.m
r10 r79 31 31 32 32 if nargin == 0 | isempty(a) 33 w = mapping(mfilename,'untrained',{h});33 w = prmapping(mfilename,'untrained',{h}); 34 34 w = setname(w,'PE Parzen Classifier'); 35 35 … … 46 46 e = testpd(sqrt(pe_distm(a)),h,'loo'); 47 47 end 48 w = mapping(mfilename,'trained',{a,h},getlablist(a),size(a,2),getsize(a,3));48 w = prmapping(mfilename,'trained',{a,h},getlablist(a),size(a,2),getsize(a,3)); 49 49 end 50 50 -
distools/private/auclpm.m
r13 r79 55 55 error('Please check your input parameters: C should be a double.'); 56 56 end 57 w = mapping(mfilename,{C,rtype,par,unitnorm,usematlab});57 w = prmapping(mfilename,{C,rtype,par,unitnorm,usematlab}); 58 58 w = setname(w,defauclpmname(C,rtype,par,unitnorm)); 59 59 return … … 204 204 W.rel = rel; 205 205 W.C = C; 206 w = mapping(mfilename,'trained',W,tlab,dim,1);206 w = prmapping(mfilename,'trained',W,tlab,dim,1); 207 207 w = setname(w,defauclpmname(C,rtype,par,unitnorm)); 208 208 -
distools/protselfd.m
r66 r79 67 67 68 68 if nargin < 1 || isempty(D) % allow for D*protselfd([],pars) 69 R = mapping(mfilename,'untrained',{ksel,type});69 R = prmapping(mfilename,'untrained',{ksel,type}); 70 70 R = setname(R,'Forward Prototype Sel'); 71 71 return -
distools/proxxm.m
r10 r79 80 80 % No data, return an UNTRAINED mapping 81 81 if (nargin < 1) | (isempty(A)) 82 W = mapping(mfilename,{type,s,weights});82 W = prmapping(mfilename,{type,s,weights}); 83 83 W = setname(W,'Proximity mapping'); 84 84 return; … … 104 104 [m,k] = size(A); 105 105 if isdataset(A) 106 W = mapping(mfilename,'trained',{A,type,s,weights},getlab(A),getfeatsize(A),getobjsize(A));106 W = prmapping(mfilename,'trained',{A,type,s,weights},getlab(A),getfeatsize(A),getobjsize(A)); 107 107 else 108 W = mapping(mfilename,'trained',{A,type,s,weights},[],k,m);108 W = prmapping(mfilename,'trained',{A,type,s,weights},[],k,m); 109 109 end 110 110 W = setname(W,'Proximity mapping'); -
distools/prtbunke.m
r10 r79 34 34 end 35 35 if ~isempty(lab), 36 D = dataset(D,lab,'featlab',lab);36 D = prdataset(D,lab,'featlab',lab); 37 37 C = classsizes(D); 38 38 % Should it be class frequencies or equal priors? -
distools/psem.m
r10 r79 79 79 end 80 80 if nargin < 1 | isempty(d), 81 W = mapping(mfilename,{alf,pzero,prec});81 W = prmapping(mfilename,{alf,pzero,prec}); 82 82 W = setname(W,'PE embedding'); 83 83 return … … 133 133 L = L(J); % Eigenvalues 134 134 135 W = mapping(mfilename,'trained',{Q, pars{2},pars{3},L,pars{5},pars{6}},[],m,length(J));135 W = prmapping(mfilename,'trained',{Q, pars{2},pars{3},L,pars{5},pars{6}},[],m,length(J)); 136 136 W = setname(W,'PE embedding'); 137 137 return … … 186 186 % Determine the mapping depending on pzero 187 187 if pzero == 0, 188 W = mapping(mfilename,'trained',{Q,mean(+d,2)',pzero,L,sig,prec},[],m,sum(sig));188 W = prmapping(mfilename,'trained',{Q,mean(+d,2)',pzero,L,sig,prec},[],m,sum(sig)); 189 189 else 190 W = mapping(mfilename,'trained',{Q,+d(:,pzero)',pzero,L,sig,prec},[],m,sum(sig));190 W = prmapping(mfilename,'trained',{Q,+d(:,pzero)',pzero,L,sig,prec},[],m,sum(sig)); 191 191 end 192 192 W = setname(W,'PE embedding'); -
distools/pspca.m
r10 r79 49 49 % 50 50 % SEE ALSO 51 % MAPPINGS, DATASETS, PCA , KPSEM, PSEM51 % MAPPINGS, DATASETS, PCAM, KPSEM, PSEM 52 52 % 53 53 % LITERATURE … … 69 69 if nargin < 2 | isempty(sig), sig = [size(a,1) 0]; end 70 70 if nargin < 1 | isempty(a), 71 W = mapping(mfilename,sig,alf,prec);71 W = prmapping(mfilename,sig,alf,prec); 72 72 W = setname(W,'Pseudo-Euclidean PCA'); 73 73 return … … 153 153 154 154 % Determine the mapping 155 W = mapping(mfilename,'trained',{v,Q,outsig,sig},[],k,sum(outsig));155 W = prmapping(mfilename,'trained',{v,Q,outsig,sig},[],k,sum(outsig)); 156 156 W = setname(W,'Pseudo-Euclidean PCA'); 157 157 return -
distools/setsig.m
r10 r79 40 40 if nargin < 2, sig = []; end 41 41 if nargin < 1 | isempty(a) 42 b = mapping(mfilename,'fixed',{sig});42 b = prmapping(mfilename,'fixed',{sig}); 43 43 b = setname(b,'Set signature'); 44 44 return … … 58 58 b = setdata(a,data); 59 59 else 60 a = dataset(a);60 a = prdataset(a); 61 61 b = setuser(a,sig,'pe_signature'); 62 62 end -
distools/simdistm.m
r10 r79 8 8 % 9 9 % OUTPUT 10 % D NxM dissimilarity matrix or dataset; D in [0,1]10 % D NxM dissimilarity matrix or prdataset; D in [0,1] 11 11 % 12 12 % DESCRIPTION -
distools/sphem.m
r10 r79 62 62 if nargin < 2 | isempty(R), R = 1; end 63 63 if nargin < 1 | isempty(d), 64 W = mapping(mfilename,{R,alf,prec});64 W = prmapping(mfilename,{R,alf,prec}); 65 65 W = setname(W,'Spherical embedding'); 66 66 return … … 82 82 W = R^2*(cos(+d/R)) * Q * diag(sqrt(abs(L))./L); 83 83 if isdataset(d), 84 W = dataset(W,getlab(d),'prior',getprior(d));84 W = prdataset(W,getlab(d),'prior',getprior(d)); 85 85 86 86 % Store signature in the USER field … … 109 109 L = L(J); % Eigenvalues 110 110 111 W = mapping(mfilename,'trained',{R,Q,L,pars{4},pars{5}},[],m,length(J));111 W = prmapping(mfilename,'trained',{R,Q,L,pars{4},pars{5}},[],m,length(J)); 112 112 W = setname(W,'Spherical embedding'); 113 113 return … … 150 150 Q = Q(:,J); % Eigenvectors 151 151 152 W = mapping(mfilename,'trained',{R,Q,L,sig,prec},[],m,sum(sig));152 W = prmapping(mfilename,'trained',{R,Q,L,sig,prec},[],m,sum(sig)); 153 153 W = setname(W,'Spherical embedding'); 154 154 return -
distools/tqdc.m
r10 r79 77 77 % No input arguments: return an UNTRAINED mapping 78 78 if (nargin < 1) | (isempty(a)) 79 w = mapping(mfilename,{alf,r,s,dim});79 w = prmapping(mfilename,{alf,r,s,dim}); 80 80 w = setname(w,'Trade-off Bayes-Normal-2'); 81 81 return … … 144 144 end 145 145 146 w = mapping('normal_map','trained',pars,getlab(U),k,c);146 w = prmapping('normal_map','trained',pars,getlab(U),k,c); 147 147 w = setname(w,'Trade-off Bayes-Normal-2'); 148 148 w = setcost(w,a);
Note: See TracChangeset
for help on using the changeset viewer.