亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pam.m

?? cluster validation tools matlab toolbox
?? M
字號:
function result = pam(x,kclus,vtype,stdize,metric,silhplot)

%PAM returns a list representing a clustering of the data into kclus
%clusters following the pam algorithm which is based on the search
%for kclus representative objects or medoids among the observations of
%the dataset
%
%The algorithm is fully described in:
%   Kaufman, L. and Rousseeuw, P.J. (1990),
%   "Finding groups in data: An introduction to cluster analysis",
%   Wiley-Interscience: New York (Series in Applied Probability and
%   Statistics), ISBN 0-471-87876-6.
%
% Required input arguments:
%   x : Data matrix (rows = observations, columns = variables)
%       Dissimilarity matrix (if number of columns equals 1)
%   kclus : The number of desired clusters
%   vtype : Variable type vector (length equals number of variables)
%       Possible values are 1  Asymmetric binary variable (0/1)
%                           2  Nominal variable (includes symmetric binary)
%                           3  Ordinal variable
%                           4  Interval variable
%       (in case x is Dissimilarity Matrix vtype isn't required.)
%
% Optional input arguments:
%   stdize : standardise the variables given by the x-matrix
%       Possible values are 0 : no standardisation
%                           1 : standardisation by the mean
%                           2 : standardisation by the median
%       (in case x is a dissimilarity matrix, stdize would be ignored)
%       (is case stdize is not given, stdize=0)
%   metric : Metric to be used (default euclidian (eucli) or mixed (mixed))
%       Possible values are 'eucli' Euclidian (all interval variables)
%                           'manha' Manhattan
%                           'mixed' Mixed (not all interval variables)
%   silhplot : draws picture
%       Possible values are 0 : do not create a silhouette plot
%                           1 : create a silhouette plot
%       (in case silhplot is not given, silhplot=0)
%
% I/O:
%   result=pam(x,kclus,vtype,'eucli',silhplot)
%
% Example (subtracted from the referenced book)
%   load ruspini.mat
%   result=pam(ruspini,2,[4 4],1);
%
% The output of PAM is a structure containing:
%   result.dys        : dissimilarities (read row by row from the
%                       lower dissimilarity matrix)
%   result.metric     : used metric
%   result.number     : number of observations
%   result.ttd        : Average silhouette width per cluster
%   result.ttsyl      : Average silhouette width for dataset
%   result.idmed      : Id of medoid observations
%   result.obj        : Objective function at the first two iterations
%   result.ncluv      : Cluster membership for each observation
%   result.clusinf    : Matrix, each row gives numerical information for
%                       one cluster. These are the cardinality of the cluster
%                       (number of observations), the maximal and average
%                       dissimilarity between the observations in the cluster
%                       and the cluster's medoid, the diameter of the cluster
%                       (maximal dissimilarity between two observations of the
%                       cluster), and the separation of the cluster (minimal
%                       dissimilarity between an observation of the cluster
%                       and an observation of another cluster).
%   result.sylinf     : Matrix, with for each observation i the cluster to
%                       which i belongs, as well as the neighbor cluster of i
%                       (the cluster, not containing i, for which the average
%                       dissimilarity between its observations and i is minimal),
%                       and the silhouette width of i.
%   result.nisol      : Vector, with for each cluster specifying whether it is
%                       an isolated cluster (L- or L*-clusters) or not isolated.
%                       A cluster is an L*-cluster iff its diameter is smaller than
%                       its separation.  A cluster is an L-cluster iff for each
%                       observation i the maximal dissimilarity between i and any
%                       other observation of the cluster is smaller than the minimal
%                       dissimilarity between i and any observation of another cluster.
%                       Clearly each L*-cluster is also an L-cluster.
%
% And PAM will create the silhouette plot if silhplot equals 1 (an empty bar indicated by
%                       zero is a sparse between two clusters).
%
% This function is part of LIBRA: the Matlab Library for Robust Analysis,
% available at:
%              http://wis.kuleuven.be/stat/robust.html
%
% Written by Guy Brys (May 2006)

%Checking and filling in the inputs
res1=[];
if (nargin<2)
    error('Two input arguments required')
elseif ((nargin<3) & (size(x,2)~=1) & (size(x,1)~=1))
    error('Three input arguments required')
elseif (nargin<3)
    if (size(x,2)==1)
        x = x';
    end
    res1.metric = 'unknown';
    res1.disv = x;
    lookup=seekN(x);
    res1.number = lookup.numb;   %(1+sqrt(1+8*size(x,1)))/2;
    stdize = 0;
    silhplot = 0;
elseif (nargin<4)
    stdize = 0;
    silhplot = 0;
    if (sum(vtype)~=4*size(x,2))
        metric = 'mixed';
    else
        metric = 'eucli';
    end
elseif (nargin<5)
    silhplot = 0;
    if (sum(vtype)~=4*size(x,2))
        metric = 'mixed';
    else
        metric = 'eucli';
    end
elseif (nargin<6)
    silhplot = 0;
end

%Replacement of missing values
for i=1:size(x,1)
    A=find(isnan(x(i,:)));
    if (~(isempty(A)))
        for j=A
            valmisdat=0;
            for c=1:size(x,2)
                if (c~=j)
                    [a,b] = sort(x(:,c));
                    if (~isempty(b(find(a==x(i,c)))))
                        valmisdat=valmisdat+find(a==x(i,c));
                    end
                end
            end
            x(i,j)=prctile(x(isnan(x(:,j))==0,j),100*valmisdat/(size(x,1)*(size(x,2)-1)));
        end
    end
end

%Standardization
if ((stdize==1) & (strcmp(metric,'eucli')))
    x = ((x - repmat(mean(x),size(x,1),1))./(repmat(std(x),size(x,1),1)));
elseif ((stdize==2) & (strcmp(metric,'eucli')))
    x = ((x - repmat(median(x),size(x,1),1))./(repmat(mad(x),size(x,1),1)));
end

%Calculating the dissimilarities with daisy
if (isempty(res1))
    res1=daisy(x,vtype,metric);
end

%Actual calculations (the second for latter use with CLUSPLOT)
[dys,ttd,ttsyl,idmed,obj,ncluv,clusinf,sylinf,nisol]=pamc(res1.number,kclus,[0 res1.disv]');
dys=res1.disv(lowertouppertrinds(res1.number));

%Create a silhouetteplot
if (silhplot==1)
    Y=sylinf(:,3);
    Y1=flipdim(Y,1);
    whitebg([1 1 1]);
    % we calculate b="a but with a bar with length zero if the objects
    % are from another cluster"
    % and h="objects but with a 0 between 2 clusters"="g with a 0 if
    % it is a sparse between 2 clusters"
    a=flipdim(Y1,1);
    b=[];
    g=sylinf(:,4);
    f=sylinf(:,1)-1;
    for j=1:res1.number
        b(j+f(j))=a(j);
        h(j+f(j))=g(j);
    end
    b1=flipdim(b,2);
    h1=flipdim(h,2);
    % we use this b1 and h1 to plot the barh (instead of a and g)
    barh(b1,1);
    title 'Silhouette Plot of Pam' ;
    xlabel('Silhouette width');
    YT=1:res1.number+(sylinf(res1.number,1)-1);
    set(gca,'YTick',YT);
    set(gca,'YTickLabel',h1);
    axis([min([Y' 0]),max([Y' 0]),0.5,res1.number+0.5+f(res1.number)]);
elseif ((silhplot~=0) & (silhplot~=1) & (nargin==6))
    error('silhplot must equals 0 or 1')
end


%Putting things together
result = struct('dys',dys,'metric',res1.metric,'number',res1.number,...
    'ttd',ttd,'ttsyl',ttsyl,'idmed',idmed,'obj',obj,'ncluv',ncluv,...
    'clusinf',clusinf,'sylinf',sylinf,'nisol',nisol,'x',x);

%------------
%SUBFUNCTIONS

function dv = lowertouppertrinds(n)

dv = [];
for i=0:(n-2)
    dv = [dv cumsum(i:(n-2))+repmat(1+sum(0:i),1,n-i-1)];
end

%---
function outn = seekN(x)

ok=0;
numb=0;
k=size(x,2);
sums=cumsum(1:k);
for i=1:k
    if(sums(i)==k)

        numb=i+1;
        ok=1;
    end
end
outn=struct('numb',numb,'ok',ok);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区三区在线看| 国产精品高潮呻吟久久| 麻豆精品视频在线观看| 欧美一级精品大片| 国产美女精品人人做人人爽| 久久久电影一区二区三区| 国产成人av一区二区三区在线| 日本一区二区三区四区| 99精品偷自拍| 日韩成人午夜精品| 国产欧美一区视频| 欧美性一区二区| 欧美老人xxxx18| 久久99精品久久久久婷婷| 久久看人人爽人人| 色综合天天做天天爱| 免费三级欧美电影| 中文字幕不卡在线观看| 欧美性感一区二区三区| 国产一区二区在线影院| 日本一区二区三区久久久久久久久不 | 亚洲欧美日韩综合aⅴ视频| 色呦呦一区二区三区| 午夜激情一区二区| 久久免费的精品国产v∧| 99精品国产99久久久久久白柏| 亚洲一区视频在线| 精品福利二区三区| 在线看一区二区| 国产精品自拍av| 亚洲高清免费观看| 国产午夜亚洲精品不卡| 欧美日韩一区二区三区视频| 激情综合网天天干| 亚洲一级二级三级| 中文字幕第一区第二区| 欧美一区二区视频免费观看| 成人性生交大片免费看在线播放| 亚洲六月丁香色婷婷综合久久 | 日韩va亚洲va欧美va久久| 久久伊99综合婷婷久久伊| 色哟哟在线观看一区二区三区| 久久精品国产99| 一区二区久久久久久| 日本一二三四高清不卡| 日韩欧美一级精品久久| 色婷婷精品大视频在线蜜桃视频| 美脚の诱脚舐め脚责91| 亚洲一区二区欧美激情| 国产精品美女久久久久久久网站| 欧美另类高清zo欧美| 91丝袜高跟美女视频| 国产精品一区二区在线看| 水野朝阳av一区二区三区| 亚洲三级小视频| 国产日本欧美一区二区| 日韩一级黄色片| 欧美疯狂做受xxxx富婆| 日本高清无吗v一区| 成人av影视在线观看| 欧美电影免费提供在线观看| 麻豆高清免费国产一区| 亚洲综合在线视频| 亚洲日本在线看| 亚洲欧洲色图综合| 国产精品欧美久久久久无广告 | 日韩精品一区二区在线| 欧美日韩精品三区| 色吊一区二区三区| 色婷婷精品久久二区二区蜜臀av| 99re在线精品| 一本到一区二区三区| 91一区二区三区在线播放| 成人av在线一区二区| 成人av免费在线播放| 国产成人综合精品三级| 懂色av一区二区三区免费看| 国产综合色在线视频区| 国产麻豆一精品一av一免费 | 亚洲一二三四在线| 国产在线一区观看| 欧美精品亚洲一区二区在线播放| 国产欧美精品在线观看| 日韩区在线观看| 日韩午夜电影在线观看| 欧美一级久久久久久久大片| 日韩欧美一二三区| 久久婷婷国产综合精品青草| 欧美精品一区二区三区蜜臀| 国产欧美日韩三级| 亚洲人被黑人高潮完整版| 亚洲一区二区三区小说| 午夜精品一区在线观看| 麻豆久久久久久| 国产传媒欧美日韩成人| 99久久综合色| 欧美日韩三级在线| 精品av久久707| 国产精品女人毛片| 亚洲资源中文字幕| 蜜臀av性久久久久av蜜臀妖精| 国内精品国产三级国产a久久| 国产精品69毛片高清亚洲| 97超碰欧美中文字幕| 欧美日韩一区二区三区四区五区| 日韩三级视频在线观看| 久久精品日产第一区二区三区高清版 | 69精品人人人人| 日韩一区二区三区观看| 久久日韩粉嫩一区二区三区| 国产精品毛片久久久久久| 亚洲少妇中出一区| 午夜久久电影网| 国产mv日韩mv欧美| 欧美人与性动xxxx| 国产亚洲美州欧州综合国| 一区二区久久久久| 另类小说色综合网站| 91麻豆国产福利在线观看| 日韩欧美精品三级| 亚洲同性gay激情无套| 美国欧美日韩国产在线播放| 欧美一级专区免费大片| 中文字幕在线不卡| 美日韩一区二区| 在线亚洲一区二区| 国产三级一区二区三区| 五月天激情综合| proumb性欧美在线观看| 日韩你懂的在线观看| 欧美三级电影网站| 色婷婷久久久久swag精品| 欧美成人免费网站| 亚洲精品国产成人久久av盗摄 | 欧美电视剧在线看免费| 亚洲精品视频在线| 国产麻豆精品theporn| 欧美精品久久久久久久多人混战 | 久久97超碰国产精品超碰| 欧美影视一区二区三区| 欧美韩国日本不卡| 美国欧美日韩国产在线播放| 欧美色图片你懂的| 日韩一区在线播放| 国产毛片一区二区| 欧美mv日韩mv亚洲| 日本欧洲一区二区| 精品视频全国免费看| 亚洲裸体在线观看| 国产69精品久久777的优势| 日韩精品在线一区二区| 欧美亚洲综合久久| 欧洲av在线精品| 国产精品欧美一区喷水| 国产一区二区三区日韩| 欧美一级片在线观看| 亚洲国产日韩综合久久精品| 99精品久久只有精品| 国产精品美女一区二区| 国产不卡在线视频| 久久精品在这里| 国产激情精品久久久第一区二区 | 国产一区二区三区av电影| 日韩三级视频在线观看| 日韩av一区二区三区| 91精品久久久久久蜜臀| 日韩高清在线电影| 精品少妇一区二区三区日产乱码| 免费观看91视频大全| 日韩欧美一二三区| 国产一区二区三区高清播放| 久久久亚洲精华液精华液精华液 | 日韩精品一区二区三区蜜臀 | 久久精品72免费观看| 欧美一级一区二区| 国内精品嫩模私拍在线| 国产色爱av资源综合区| 99久久99久久综合| 亚洲一区在线观看免费| 91精品国产综合久久精品麻豆| 色哟哟欧美精品| 亚洲小少妇裸体bbw| 91精品国产手机| 免费成人av在线| 久久亚洲捆绑美女| 99久久精品免费看国产免费软件| 亚洲精品一二三区| 欧美一激情一区二区三区| 国产资源在线一区| 中文字幕欧美日韩一区| 91高清在线观看| 日本aⅴ亚洲精品中文乱码| 2023国产精品自拍| 99v久久综合狠狠综合久久| 亚洲一区在线观看免费观看电影高清| 欧美人妇做爰xxxⅹ性高电影| 看片的网站亚洲| 国产精品美女久久久久久久久| 色噜噜狠狠色综合欧洲selulu| 丝袜亚洲精品中文字幕一区|