Znn3bq.jpeg
²é¿´: 459  |  »Ø¸´: 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 µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] 290µ÷¼ÁÉúÎï0860 +26 ÍÛ¹þ¹þ£¬¡£ 2026-04-11 29/1450 2026-04-12 16:54 by ajpv·çÀ×
[½Ìʦ֮¼Ò] ɽ¶«Ë«·ÇԺУ¿¼ºË³¬¼¶ÎÞµ×Ïߣ¬Áìµ¼ÐÒÔÖÀÖ»ö£¬½ÌʦÔâÑê¿Ö +3 qut2026 2026-04-11 4/200 2026-04-12 16:32 by aheyingwhg
[¿¼ÑÐ] Çóµ÷¼Á£¬985²ÄÁÏÓ뻯¹¤348·Ö +8 º­ÖñÁõ 2026-04-11 10/500 2026-04-12 10:01 by ´óÁ¦Ë®ÊÖÁ¦´óÎÞÇ
[¿¼ÑÐ] 0854µ÷¼Á +12 ³¤¹­°Á 2026-04-09 13/650 2026-04-12 09:56 by ÄæË®³Ë·ç
[¿¼ÑÐ] һ־Ըн®´óѧ085401£¬314·Ö +4 ßÇßÇßÇßÇ9 2026-04-05 4/200 2026-04-12 02:21 by Çï¶¹²ËÑ¿
[¿¼ÑÐ] Çóµ÷¼Á +11 ÔÂ@163.com 2026-04-07 13/650 2026-04-11 22:55 by BruceLiu320
[¿¼ÑÐ] ²ÄÁϹ¤³ÌÈÕÓÉúÇóµ÷¼Á +7 0856?µ÷¼Á 2026-04-10 7/350 2026-04-11 21:33 by À¶ÔÆË¼Óê
[¿¼ÑÐ] 283Çóµ÷¼Á +22 ÄǸöàà×Ó 2026-04-09 22/1100 2026-04-11 10:41 by ÄæË®³Ë·ç
[¿¼ÑÐ] ũѧ0904 312Çóµ÷¼Á +6 Say Never 2026-04-10 6/300 2026-04-11 10:33 by wwj2530616
[¿¼ÑÐ] µ÷¼Á »¯Ñ§ 307 +21 73372112 2026-04-09 23/1150 2026-04-10 23:53 by wj165256
[¿¼ÑÐ] 284Çóµ÷¼Á +9 ÈÃÎÒÉϰ¶°É°¢Î÷ 2026-04-09 11/550 2026-04-10 19:18 by ¾¸jing
[¿¼ÑÐ] 0858Çóµ÷¼Á 5+5 Gky09300550£¬ 2026-04-10 8/400 2026-04-10 19:13 by chemisry
[¿¼ÑÐ] 296Çóµ÷¼Á +6 Íô£¡£¿£¡ 2026-04-08 6/300 2026-04-10 11:02 by mattzhming
[¿¼²©] ²©Ê¿×Ô¼ö +7 ¿É¿ÉСÅÖ 2026-04-08 7/350 2026-04-10 08:28 by kimhero
[¿¼ÑÐ] ³õÊÔ·Ö332£¬Ò»Ö¾Ô¸±¨¿¼Î÷±±¹¤Òµ´óѧ£¬ +11 ¹ÊÈË?? 2026-04-09 11/550 2026-04-09 21:54 by JineShine
[¿¼ÑÐ] 284Çóµ÷¼Á +7 ÈÃÎÒÉϰ¶°É°¢Î÷ 2026-04-09 7/350 2026-04-09 18:59 by haironglove
[¿¼ÑÐ] ÉúÎïѧ308·ÖÇóµ÷¼Á£¨Ò»Ö¾Ô¸»ª¶«Ê¦´ó£© +13 ÏàÐűػá¹ââÍòÕ 2026-04-06 16/800 2026-04-09 13:54 by ÐìÁ¼°×ü´óÏÀ
[¿¼ÑÐ] 353Çóµ÷¼Á +8 Çç¿ÕÍòÀïair 2026-04-07 8/400 2026-04-09 00:18 by GouQ
[¿¼ÑÐ] 285Çóµ÷¼Á +5 mapmath 2026-04-06 6/300 2026-04-06 17:18 by À¶ÔÆË¼Óê
[¿¼ÑÐ] Ò»Ö¾Ô¸ºÓ±±¹¤Òµ´óѧ²ÄÁϹ¤³Ì£¬³õÊÔ344Çóר˶µ÷¼Á +6 15933906766 2026-04-05 6/300 2026-04-06 13:21 by Î޼ʵIJÝÔ­
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û