24СʱÈÈÃŰæ¿éÅÅÐаñ    

Znn3bq.jpeg
²é¿´: 460  |  »Ø¸´: 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(kk+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

[ À´×Ô¿ÆÑмÒ×å È˹¤ÖÇÄÜ ]
»Ø¸´´ËÂ¥
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

nono2009

³¬¼¶°æÖ÷ (ÎÄѧ̩¶·)

No gains, no pains.

ÓÅÐãÇø³¤ÓÅÐãÇø³¤ÓÅÐãÇø³¤ÓÅÐãÇø³¤ÓÅÐã°æÖ÷

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
Ï£ÍûÄÜÏêϸ½âÊÍÒ»ÏÂÿ¾äµÄÒâ˼£¿ÄǹÀ¼ÆÃ»ÓÐÈËÕâôÓпա£
½¨ÒéÏȸãÃ÷°×Õâ¸ö³ÌÐò±³ºóµÄÔ­Àí£¬È»ºóÔÙ¶Á³ÌÐò¾Í»á±È½Ï¼òµ¥¡£
2Â¥2012-05-23 18:00:09
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

lijie169

Í­³æ (ÖøÃûдÊÖ)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
Ã²ËÆÊÇ·ÖÀà»ùÓÚMI·ÖÀàµÄ£¬Ô­ÀíÊÇ»ùÓÚ¾àÀë
3Â¥2012-05-24 13:49:43
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
Ïà¹Ø°æ¿éÌø×ª ÎÒÒª¶©ÔÄÂ¥Ö÷ xiaoyaojushi µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] 277Çóµ÷¼Á +22 Äß½¨Éè 2026-04-06 22/1100 2026-04-12 18:18 by ѧzh
[¿¼ÑÐ] 0831Ò»ÂÖµ÷¼Áʧ°ÜÇóÖú +9 СÐÜî£î£_s 2026-04-11 9/450 2026-04-12 14:18 by À¥¹¤¸ßÐÀ
[¿¼ÑÐ] 327Çóµ÷¼Á +5 ʰ¹âÈÎȾ 2026-04-06 5/250 2026-04-12 02:29 by Çï¶¹²ËÑ¿
[¿¼ÑÐ] 299Çóµ÷¼Á +8 ZVVZ13 2026-04-08 8/400 2026-04-12 00:40 by À¶ÔÆË¼Óê
[¿¼ÑÐ] 270Çóµ÷¼Á +14 ÑîÀÖ369 2026-04-11 14/700 2026-04-11 20:16 by À¶ÔÆË¼Óê
[¿¼ÑÐ] 085400 328·Ö Çóµ÷¼Á +10 ιÄãÒ»¸ö´ó³È×Ó 2026-04-09 14/700 2026-04-11 19:53 by lqspecial
[¿¼ÑÐ] Çóµ÷¼Á +3 θ¾·ÂÎÀÛÁË 2026-04-11 5/250 2026-04-11 14:13 by luhong1990
[¿¼ÑÐ] »¯Ñ§308·ÖÇóµ÷¼Á +22 ÄãºÃÃ÷ÌìÄãºÃ 2026-04-07 24/1200 2026-04-11 11:14 by ChemPharm
[¿¼ÑÐ] 085600²ÄÁÏÓ뻯¹¤329·ÖÇóµ÷¼Á +16 Ò¶zilin 2026-04-10 16/800 2026-04-11 11:04 by may_ÐÂÓî
[¿¼ÑÐ] ²ÄÁÏÓ뻯¹¤µ÷¼Á 10+11 ÏÂÒ»Õ¾Éϰ¶@ 2026-04-10 36/1800 2026-04-11 10:26 by 89436494
[¿¼ÑÐ] 080100Á¦Ñ§316Çóµ÷¼Á +8 L_Hairui 2026-04-07 8/400 2026-04-11 10:00 by zhq0425
[¿¼ÑÐ] ²ÄÁÏÀà284µ÷¼Á +40 Ïë»»ÊÖ»ú²»Ïë½âÊ 2026-04-08 48/2400 2026-04-10 23:28 by 314126402
[¿¼ÑÐ] Ò»Ö¾Ô¸»ªÄÏÀí¹¤´óѧ331·Ö²ÄÁÏÇóµ÷¼Á +9 ÌìÏÂww 2026-04-09 9/450 2026-04-10 22:58 by Ftglcn90
[¿¼ÑÐ] µ÷¼Á +12 ¾í¾í¾íÐIJË_ 2026-04-09 13/650 2026-04-10 22:36 by Ftglcn90
[¿¼ÑÐ] »úеר368 ÓÐÈ¥´¦Âð +4 ÖÖ´óÊ÷ 2026-04-10 4/200 2026-04-10 15:31 by jiajinhpu
[¿¼ÑÐ] Ò»Ö¾Ô¸Î÷½»»úеר˶Çóµ÷¼Á +8 ÇóÉϰ¶µÄСÍõ 2026-04-10 8/400 2026-04-10 15:09 by hemengdong
[¿¼ÑÐ] 344Çóµ÷¼Á +7 ؼ·çѩҹ¹éÈËØ¼ 2026-04-09 7/350 2026-04-10 12:05 by pengliang8036
[¿¼ÑÐ] 070300»¯Ñ§ Çóµ÷¼Á +13 73372112 2026-04-08 13/650 2026-04-09 20:22 by maddjdld
[¿¼ÑÐ] 308Çóµ÷¼Á +17 īīĮ 2026-04-06 17/850 2026-04-09 09:25 by Ò¼ÍùŸoǰ
[¿¼ÑÐ] 22408 µ÷¼Á²ÄÁÏ +7 ÎÒ½Ðez 2026-04-06 8/400 2026-04-07 17:12 by À¶ÔÆË¼Óê
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û