| ²é¿´: 527 | »Ø¸´: 2 | ||||
| µ±Ç°Ö»ÏÔʾÂú×ãÖ¸¶¨Ìõ¼þµÄ»ØÌû£¬µã»÷ÕâÀï²é¿´±¾»°ÌâµÄËùÓлØÌû | ||||
xiaoyaojushiгæ (³õÈëÎÄ̳)
|
[ÇóÖú]
matlabÇóÖú
|
|||
|
ÇëÎʰïÎÒ½âÊÍÒ»ÏÂÕâ¸ö³ÌÐòµÄÒâ˼°É£¬Ï£ÍûÄÜÏêϸ½âÊÍÒ»ÏÂÿ¾äµÄÒâ˼£¡ function [res mi]=forward_sel_class(X,Y,k) % Forward feature selection using the MI criterion. % X is a dataset (n x d) with n samples and d features and Y is the class % vector with classes denoted 1, 2 ... c. [s1,s2]=size(X); res = []; remainingset = [1:size(X,2)]; for j=1:size(X,2) j; currscore=[]; for i=1:length(remainingset) tempset = [res remainingset(i)]; tempscore=miv_opt(X(:,tempset),Y,k); currscore(i, =tempscore;end [winnerscore, winner] = max(currscore); mi(i)=winnerscore; res = [res remainingset(winner)]; remainingset(winner) = []; end function res = miv(X,Y,k) if(size(Y,1) > size(Y,2)) Y = Y'; end warning off % Estimate mutual information between X ad Y with Y a discrete random variable % and X a real random vector % k must be smaller than the minimum number of points in a class. load digammaMAT; Y = 1 + Y - min(Y); [N,d] = size(X); % Sample size and dimension C = full(ind2vec(Y))'; % Matrix of binary class description [N, L] = size(C); % Sample size and number of classes cN = sum(C); % sample size of each class for l=1:L, digammacN(l) = digammaMAT(cN(l));end distmat = pairwisedistances(X,2); epsilonallclasses = zeros(N,1); epsilonsameclass = zeros(N,1); for j = 1:N % get vector of all distances dist = distmat(j, ;% sort this vector [sorteddistances, distanceindices] = sort(dist); % find the distance to the k th neighbour epsilonallclasses(j) = 2*sorteddistances(k+1); % the first neighbour is the point itself % find the distance to the k th neighbour in the same class whichclass = Y(j); mask = C(:,whichclass); mask = mask(distanceindices); sorteddistancesinsameclass = sorteddistances(find(mask)); epsilonsameclass(j) = 2*sorteddistancesinsameclass(k+1); end res = digammaMAT(N) - 1/N * sum(cN.*digammacN)+ d/N * sum((log(epsilonallclasses))-(log(epsilonsameclass))); res=res/log(2); % ajout % if (isnan(res)==1)|(res==-Inf)|(res<0) % res=0; % end % if j is specified, output is the distance from all points in X to j % otherwise, output is a full squared distance matrix with all distances % between all points function [res] = pairwisedistances(X, pp,j) [n,p] = size(X); if nargin < 3 %outClass = class(X); Y = zeros(1,n*(n-1)./2, 'single'); k = 1; for i = 1:n-1 dsq = zeros(n-i,1,'single'); for q = 1:p dsq = dsq + abs(X(i,q) - X((i+1):n,q)).^pp; end Y(k k+n-i-1)) = (dsq).^(1/pp);k = k + (n-i); end res = squareform(Y); else res = (sum(abs(X-repmat(X(j, ,n,1)).^pp,2)).^(1/pp);end [ À´×Ô¿ÆÑмÒ×å È˹¤ÖÇÄÜ ] |
» ²ÂÄãϲ»¶
¹ú×ÔÈ»ÆÀÉóÒâ¼û
ÒѾÓÐ10È˻ظ´
¹ú×ÔÈ»ÃæÉϸ´ÅÌ~»¶ÓÌÖÂÛ
ÒѾÓÐ14È˻ظ´
ϵͳ²é²»µ½
ÒѾÓÐ11È˻ظ´
ÓжàÉÙÈËÊǽñÌì²éϵͳ֪µÀ½á¹ûµÄ£¿
ÒѾÓÐ18È˻ظ´
Ϊʲô×ÊÖúÊý¸÷´ó¸ßУ¶¼´´Ð¸ߣ¬×Ô¼ºÉêÇëÔõô¾ÍÕâôÄÑ
ÒѾÓÐ12È˻ظ´
ÓÐûÓÐÈÔûÊÕµ½ÐÅÏ¢µÄ
ÒѾÓÐ3È˻ظ´
µ¼Ê¦Í²ۣºÎÒÔõô̯ÉÏÁËÕâô¸ö¼«Æ·Ñо¿Éú£¡
ÒѾÓÐ8È˻ظ´
»ù½ð²»ÖУ¬¹²Ãã
ÒѾÓÐ11È˻ظ´
Â鷳ר¼ÒÃÇ¿´¿´ÆÀίÃǵÄÒâ¼û£¨F¿ÚÃæÉÏ£©
ÒѾÓÐ9È˻ظ´
2026ÄêÒ¶ÆóËï»ù½ð
ÒѾÓÐ6È˻ظ´
lijie169
ͳæ (ÖøÃûдÊÖ)
- Ó¦Öú: 159 (¸ßÖÐÉú)
- ½ð±Ò: 161.5
- É¢½ð: 2018
- ºì»¨: 7
- Ìû×Ó: 1338
- ÔÚÏß: 491.5Сʱ
- ³æºÅ: 1180408
- ×¢²á: 2010-12-30
- רҵ: ·ÖÀë¹ý³Ì
3Â¥2012-05-24 13:49:43
nono2009
³¬¼¶°æÖ÷ (ÎÄѧ̩¶·)
No gains, no pains.
-

ר¼Ò¾Ñé: +21105 - Ó¦Öú: 28684 (Ժʿ)
- ¹ó±ö: 513.911
- ½ð±Ò: 2555230
- É¢½ð: 27828
- ºì»¨: 2148
- ɳ·¢: 66666
- Ìû×Ó: 1602255
- ÔÚÏß: 65200.9Сʱ
- ³æºÅ: 827383
- ×¢²á: 2009-08-13
- ÐÔ±ð: GG
- רҵ: ¹¤³ÌÈÈÎïÀíÓëÄÜÔ´ÀûÓÃ
- ¹ÜϽ: ¿ÆÑмҳﱸίԱ»á
¡¾´ð°¸¡¿Ó¦Öú»ØÌû
¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
|
Ï£ÍûÄÜÏêϸ½âÊÍÒ»ÏÂÿ¾äµÄÒâ˼£¿ÄǹÀ¼ÆÃ»ÓÐÈËÕâôÓпա£ ½¨ÒéÏȸãÃ÷°×Õâ¸ö³ÌÐò±³ºóµÄÔÀí£¬È»ºóÔÙ¶Á³ÌÐò¾Í»á±È½Ï¼òµ¥¡£ |
2Â¥2012-05-23 18:00:09









=tempscore;
k+n-i-1)) = (dsq).^(1/pp);
»Ø¸´´ËÂ¥
10