資源簡介
以鄰域粗糙集的屬性重要度作為量度,從一個空集出發,前向貪心的選擇重要度大的屬性并入到約簡集合,直到達到約簡條件

代碼片段和文件信息
function?[select_feature]=fs_SD_Gread(sDatan)
%%?fs_SD_Gread?函數返回基于標準差的貪心算法得到的屬性約簡
%%?sData:?數據
%%?n:?控制領域大小的參數
[rowcolumn]=size(sData.data);
aaaaa=0;
%%?得到鄰域關系
neighborRelation=my_SD_getNeighborRelation(sDatan);
r=neighborRelation{column+1};
n=[];
x=0;
base=ones(row);
pos=[];
attrinu=column;
for?j=attrinu:-1:1
????sig=[];????
????
????%縮減決策屬性的鄰域關系和base矩陣
????r(pos:)=[];
????r(:pos)=[];
????base(:pos)=[];
????base(pos:)=[];
????
????%當所有元素都剔除時,跳出
????if?isempty(base)
????????break;
????end
????
????%縮減鄰域關系
????for?l=1:attrinu
????????a=neighborRelation{l};
????????a(pos:)=[];
????????a(:pos)=[];
????????neighborRelation{l}=a;
????end
????%poss?用來存放正域即下近似
????poss=cell(1attrinu);
????
????for?l=1:attrinu
????????r2=neighborRelation{l};
????????r1=min(r2base);????
????????
?????????????
????????rrr=size(r12);
????????importance=row-rrr;
????????
????????po=zeros(rrr);
????????aaaaa=aaaaa+rrr;
????????for?i=1:rrr???????????
????????????temp=min([r1(i:);r(i:)]);
????????????incluse=sum(temp)/sum(r1(i:));
????????????if?incluse>=1
????????????????po(i)=i;
????????????????importance=importance+sum(temp)/length(find(temp~=0));
????????????end????????????
????????end
????????%?剔除po中的非零元素
????????po=po(po~=0);%速度較快,比?a(~any(a1))=[]快
????????
????????poss{l}=po;
????????sig(l)=importance/row;
????end
?????
????[x1n1]=max(sig);
????
????pos=poss{n1};
????x=[x;x1];
????len=length(x);
????if?abs(x(len)-x(len-1))>0.001
????????base1=neighborRelation{n1};
????????base=min(basebase1);????????
????????n=[n;n1];
????else
????????break
????end
end
select_feature=n;
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1770??2010-08-16?18:50??FS_NRS_GREAD\fs_SD_Gread.m
?????文件????????881??2010-07-20?15:21??FS_NRS_GREAD\my_SD_getNeighborRelation.m
?????文件??????21567??2010-08-16?17:13??FS_NRS_GREAD\wine.mat
?????目錄??????????0??2010-08-20?22:33??FS_NRS_GREAD
-----------?---------??----------?-----??----
????????????????24218????????????????????4
評論
共有 條評論