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

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

?? cluster3.c

?? 聚類算法全集以及內附數(shù)據(jù)集
?? C
字號:
/*----------------------------------------------------------------------  File    : cluster3.c  Contents: cluster validity measures  Author  : Christian Borgelt  History : 17.05.2003 file created----------------------------------------------------------------------*/#include <stdlib.h>#include <limits.h>#include <float.h>#include <math.h>#include <assert.h>#include "cluster.h"/*----------------------------------------------------------------------  Preprocessor Definitions----------------------------------------------------------------------*/#define LN_2         0.69314718055994530942  /* ln(2) *//*----------------------------------------------------------------------  Type Definitions----------------------------------------------------------------------*/typedef double CLSVALFN (CLSET *clset);/*----------------------------------------------------------------------  Auxiliary Functions----------------------------------------------------------------------*/static double _intexp (double x, int n){                               /* --- fast integer exponentiation */  double r = (n & 1) ? x : 1;   /* result */  for (n >>= 1; n > 0; n >>= 1) {    x *= x;                     /* traverse the powers of 2 and */    if (n & 1) r *= x;          /* if the corr. exponent bit is set */  }                             /* multiply them into the result */  return r;                     /* return the result */}  /* _intexp() *//*--------------------------------------------------------------------*/static double _dist (CLSET *clset, CLUSTER *c1, CLUSTER *c2){                               /* --- distance of clusters */  int    i;                     /* loop variable */  double *b;                    /* center difference vector */  for (b = clset->buf, i = clset->incnt; --i >= 0; )    b[i] = c1->ctr[i] -c2->ctr[i];  if (clset->type & CLS_COVARS) /* if to use covariances */    return 0.5 *(mat_mulvmv(c1->inv, b) +mat_mulvmv(c2->inv, b));  if (clset->type & CLS_VARS)   /* if to use only variances */    return 0.5 *(mat_mulvdv(c1->inv, b) +mat_mulvdv(c2->inv, b));  if (clset->type & CLS_SIZE)   /* if to use only isotropic variance */    return vec_sqrlen(b, clset->incnt) / (0.5 *(c1->var +c2->var));  return vec_sqrlen(b, clset->incnt);}  /* _dist() */                /* if to use no size *//*----------------------------------------------------------------------  Cluster Validity Functions----------------------------------------------------------------------*/static double _objfn (CLSET *clset){                               /* --- objective function */  int     i;                    /* loop variable */  CLUSTER *c;                   /* to traverse the clusters */  double  r = 0;                /* result */  for (c = clset->cls +(i = clset->clscnt); --i >= 0; )    r += (--c)->val[1];         /* sum the weighted distance sums */  return r;                     /* and return this sum */}  /* _objfn() *//*--------------------------------------------------------------------*/static double _coverage (CLSET *clset){                               /* --- coverage of data points */  return clset->eval.sum;       /* return the sum of membership degs. */}  /* _coverage() *//*--------------------------------------------------------------------*/static double _fdbidx (CLSET *clset){                               /* --- fuzzy Davies-Bouldin index */  int     i, k;                 /* loop variables */  CLUSTER *c1, *c2;             /* to traverse the clusters */  double  max, t;               /* maximum of values, buffer */  double  r = 0;                /* result */  for (c1 = clset->cls +(i = clset->clscnt); --i >= 0; ) {    --c1;                       /* traverse the clusters */    c1->val[3] = (c1->val[0] > 0) ? c1->val[1]/c1->val[0] : 0;  }                             /* compute the average distances */  for (c1 = clset->cls +(i = clset->clscnt); --i >= 0; ) {    --c1; max = 0;              /* traverse the clusters */    for (c2 = clset->cls +(k = clset->clscnt); --k >= 0; ) {      if (--c2 == c1) continue; /* traverse the other clusters */      t = _dist(clset, c1, c2); /* compute the cluster distance */      t = (t > 0) ? (c1->val[3] +c2->val[3]) /t : 0;      if (t > max) max = t;     /* determine the maximum */    }                           /* of the size to distance ratio */    r += max;                   /* and sum these maxima */  }  return r /clset->clscnt;      /* return the average over clusters */}  /* _fdbidx() *//*--------------------------------------------------------------------*/static double _pcoeff (CLSET *clset){                               /* --- partition coefficient */  return clset->eval.sqr /clset->eval.cnt;}  /* _pcoeff() *//*--------------------------------------------------------------------*/static double _pcnorm (CLSET *clset){                               /* --- norm. partition coefficient */  if ((clset->clscnt <= 1) || (clset->eval.cnt <= 0))    return 0;                   /* check for valid denominators */  return 1 -(clset->clscnt /(clset->clscnt -1))           *(1 -clset->eval.sqr /clset->eval.cnt);}  /* _pcnorm() *//*--------------------------------------------------------------------*/static double _pentropy (CLSET *clset){                               /* --- partition entropy */  return (clset->eval.ent < 0)       ? -clset->eval.ent /(clset->clscnt*LN_2) : 0;}  /* _pentropy() *//*--------------------------------------------------------------------*/static double _fhypvol (CLSET *clset){                               /* --- fuzzy hyper-volume */  int     i;                    /* loop variable */  CLUSTER *c;                   /* to traverse the clusters */  double  r = 0;                /* result */  for (c = clset->cls +(i = clset->clscnt); --i >= 0; )    r += pow((--c)->var, 0.5*clset->incnt);  return r;                     /* sum the roots of the determinants */}  /* _fhypvol() */             /* and return this sum *//*--------------------------------------------------------------------*/static double _prpexp (CLSET *clset){                               /* --- proportion exponent */  return clset->eval.pxp /LN_2;}  /* _prpexp() *//*--------------------------------------------------------------------*/static double _sepdeg (CLSET *clset){                               /* --- separation degree */  int     i, k;                 /* loop variables */  CLUSTER *c1, *c2;             /* to traverse the clusters */  double  min = DBL_MAX;        /* minimum of cluster distances */  double  r   = 0, t;           /* result, temporary buffer */  if (clset->clscnt <= 1) return 0;  for (c1 = clset->cls +(i = clset->clscnt); --i >= 0; ) {    r += (--c1)->val[1];        /* compute the objective function */    for (c2 = clset->cls +(k = clset->clscnt); --k >= 0; ) {      if (--c2 == c1) continue; /* traverse the other clusters */      t = _dist(clset, c1, c2); /* compute the cluster distance */      if (t < min) min = t;     /* and determine the minimum */    }                           /* of these distances */  }  min *= clset->eval.cnt;       /* compute the denominator and */  return (min > 0) ? r/min : 0; /* return the separation degree */}  /* _sepdeg() *//*--------------------------------------------------------------------*/static double _partdens (CLSET *clset){                               /* --- partition density */  int     i;                    /* loop variable */  CLUSTER *c;                   /* to traverse the clusters */  double  r = 0, d = 0;         /* result and denominator */  for (c = clset->cls +(i = clset->clscnt); --i >= 0; ) {    r += (--c)->val[2];         /* sum the assigned points sum */    d += pow(c->var, 0.5*clset->incnt);  }                             /* sum the roots of the determinants */  return (d > 0) ? r/d : 0;     /* return the partition density */}  /* _partdens() *//*--------------------------------------------------------------------*/static double _pdavg (CLSET *clset){                               /* --- average partition density */  int     i;                    /* loop variable */  CLUSTER *c;                   /* to traverse the clusters */  double  r = 0, t;             /* result, temporary buffer */  for (c = clset->cls +(i = clset->clscnt); --i >= 0; ) {    t = pow((--c)->var, 0.5*clset->incnt);    if (t > 0) r += c->val[2] /t;  }                             /* cluster-spec. partition density */  return r / clset->clscnt;     /* compute and return average */}  /* _pdavg() *//*--------------------------------------------------------------------*/static double _noise (CLSET *clset){                               /* --- sum of m.s. to noise cluster */  return clset->eval.noise;}  /* _noise() *//*--------------------------------------------------------------------*/static CLSVALFN *_clsvalfn[] = {  /* CLS_OBJFN     0 */  _objfn,  /* CLS_COVERAGE  1 */  _coverage,  /* CLS_FDBIDX    2 */  _fdbidx,  /* CLS_PCOEFF    3 */  _pcoeff,  /* CLS_PCNORM    4 */  _pcnorm,  /* CLS_PENTROPY  5 */  _pentropy,  /* CLS_FHYPVOL   6 */  _fhypvol,  /* CLS_PRPEXP    7 */  _prpexp,  /* CLS_SEPDEG    8 */  _sepdeg,  /* CLS_PARTDENS  9 */  _partdens,  /* CLS_PDAVG    10 */  _pdavg,  /* CLS_NOISE    11 */  _noise,};/*----------------------------------------------------------------------  Main Functions----------------------------------------------------------------------*/void cls_evcfg (CLSET *clset, int measure, double param){                               /* --- configure cluster evaluation */  int     i;                    /* loop variable */  CLUSTER *c;                   /* to traverse the clusters */  CLSEVAL *e = &clset->eval;    /* evaluation variables */  assert(clset);                /* check the function argument */  if (measure < 0) {            /* if no measure is given, */    e->flags = 0;               /* clear all measure flags */    for (c = clset->cls +(i = clset->clscnt); --i >= 0; )      c->val[0] = c->val[1] = c->val[2] = 0;    e->cnt = e->sum = e->sqr = e->ent = e->pxp = e->noise = 0; }  else {                        /* if a measure is given */    e->flags |= 1 << measure;   /* set the measure flag */    if (measure == CLS_PRPEXP)  /* note the parameter */      e->rad = param;           /* for the proportion exponent */  }                             /* (minimal membership degree) */}  /* cls_evcfg() *//*--------------------------------------------------------------------*/void cls_evaggr (CLSET *clset, const double *vec, double weight){                               /* --- aggregate for evaluation */  int     i, k, n;              /* loop variable */  CLUSTER *c;                   /* to traverse the clusters */  CLSEVAL *e;                   /* evaluation variables */  double  max = 0;              /* maximum membership degree */  double  t, x, y;              /* temporary buffer */  assert(clset);                /* check the function argument */  cls_exec(clset, vec, NULL);   /* execute the cluster set */  e = &clset->eval;             /* get the evaluation variables */  e->cnt += weight;             /* sum the pattern weight */  x = fabs(clset->msexp);       /* get the adaptation exponent */  if (x <= 0) x = 1;            /* and adapt it */  y = (e->flags & CLS_PENTROPY) ? 0 : DBL_MAX;  for (c = clset->cls +(i = clset->clscnt); --i >= 0; ) {    t = (--c)->msd;             /* traverse the clusters */    e->sum += t*weight;         /* sum the membership degrees */    e->sqr += t*t*weight;       /* and their squares */    if (t > max) max = t;       /* determine their maximum */    if (t > y) e->ent += t *log(t);    if (c->d2 < e->rad) c->val[2] += t;    if      (x == 2) t *= 2;    /* use adaptation exponent */    else if (x != 1) t = pow(t, x);    c->val[0] += t *= weight;   /* sum the membership degrees */    c->val[1] += t *c->d2;      /* and the weighted distances */  }                             /* for each cluster */  e->noise += clset->msd[1];    /* sum memberships to noise cluster */  if (e->flags & CLS_PRPEXP) {  /* if to compute proportion exponent */    x = 0; y = -1; i = clset->clscnt;    n = (int)floor(1/max);      /* compute number of clusters */    if (n > clset->clscnt << 6) n = clset->clscnt << 6;    for (k = 1; k <= n; k++) {  /* and traverse them */      y *= (k -i -1) / k;       /* compute next t choose k */      x += y *_intexp(1 -k *max, i -1);    }                           /* add next term */    e->pxp -= log(x);           /* sum the logarithms */  }                             /* of cluster-specific terms */}  /* cls_evaggr() *//*--------------------------------------------------------------------*/double cls_eval (CLSET *clset, int measure){                               /* --- compute evaluation measure */  if ((measure < 0) || (measure >= CLS_VMCNT))    return 0;                   /* check the measure range */  return _clsvalfn[measure](clset);}  /* cls_eval() */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区在线免费观看视频| 国产精品剧情在线亚洲| 亚洲欧洲综合另类在线| 色天天综合色天天久久| 亚洲一级二级三级| 欧美大片国产精品| 91亚洲大成网污www| 日韩电影在线观看网站| 久久免费的精品国产v∧| av网站一区二区三区| 日韩av在线发布| 国产精品成人免费在线| 日韩午夜激情电影| 91性感美女视频| 成人开心网精品视频| 国产一区二区三区免费观看| 中文字幕在线不卡| 在线综合+亚洲+欧美中文字幕| 蜜桃视频一区二区| 一区二区三区四区亚洲| 欧美一区二区三区婷婷月色| 国产xxx精品视频大全| 亚洲成人一区二区在线观看| 国产精品久久久久一区| 精品国产免费人成电影在线观看四季 | 国产午夜亚洲精品不卡| 日本韩国一区二区| 色综合久久久久久久| 成人av影院在线| 国产精品77777竹菊影视小说| 美女网站色91| 国产乱码精品1区2区3区| 日本不卡的三区四区五区| 亚洲大片在线观看| 日本不卡一区二区三区高清视频| 亚洲一区二区三区四区的| 亚洲成a天堂v人片| 午夜欧美一区二区三区在线播放| 亚洲精选视频在线| 亚洲一级二级三级| 久久99国产精品麻豆| 国产乱国产乱300精品| 成人爽a毛片一区二区免费| 国产91露脸合集magnet| 91视频91自| 日韩欧美成人激情| 日韩美女视频一区| 秋霞午夜鲁丝一区二区老狼| 日韩精品电影在线观看| 色av成人天堂桃色av| 欧美日韩日日摸| 日韩一区二区三区在线观看 | 国产精品亚洲一区二区三区在线| 豆国产96在线|亚洲| 欧美日韩视频不卡| 国产欧美日韩卡一| 久久精品久久精品| 欧美性感一类影片在线播放| 久久午夜羞羞影院免费观看| 国产91高潮流白浆在线麻豆| 一区二区三区四区精品在线视频| 免费在线视频一区| 欧美人体做爰大胆视频| **欧美大码日韩| 成人少妇影院yyyy| 久久先锋影音av鲁色资源网| 亚洲va欧美va国产va天堂影院| 久久国产精品色婷婷| 97se狠狠狠综合亚洲狠狠| 久久日韩粉嫩一区二区三区| 视频一区二区三区在线| 色综合久久精品| 亚洲精品免费一二三区| 91无套直看片红桃| 国产精品国产馆在线真实露脸 | 欧美日韩国产高清一区二区三区 | 欧美亚洲尤物久久| 国产精品色婷婷久久58| 成人动漫在线一区| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 激情图片小说一区| 国产精品系列在线| 91啪在线观看| 日本伊人午夜精品| 中文字幕第一页久久| 91热门视频在线观看| 日本亚洲三级在线| 欧美一区二区日韩| 日欧美一区二区| 亚洲日韩欧美一区二区在线| 欧美日韩综合一区| 国产一区二区免费在线| 亚洲精品免费在线观看| 日韩一区二区影院| 在线免费观看成人短视频| 免费视频一区二区| 亚洲欧美日本在线| 欧美精品一区视频| 91精品国产乱码久久蜜臀| 日韩毛片精品高清免费| 欧美男同性恋视频网站| 国产丶欧美丶日本不卡视频| 午夜欧美视频在线观看| 欧美国产综合色视频| 日韩一区二区三区在线观看| 99久久伊人精品| 高清不卡一区二区在线| 日本不卡一区二区三区| 一个色在线综合| 自拍视频在线观看一区二区| 久久久久久麻豆| 久久综合久久鬼色| 精品国产电影一区二区 | 色视频一区二区| 99精品视频在线观看免费| 激情综合色播激情啊| 国产精品白丝jk黑袜喷水| 免费av成人在线| 激情综合五月婷婷| 国产成人精品亚洲日本在线桃色| 麻豆久久一区二区| 国产中文字幕精品| 成人午夜看片网址| 色婷婷国产精品久久包臀 | 一区二区理论电影在线观看| 亚洲精品免费视频| 日韩av在线免费观看不卡| 美女视频网站久久| 成人avav影音| 欧美日韩黄色一区二区| 精品国产乱码久久久久久1区2区 | 国产成人精品一区二| 欧美性欧美巨大黑白大战| 欧美成人官网二区| 国产亚洲精品精华液| 亚洲午夜免费视频| 国产一区二区三区香蕉| 在线欧美一区二区| 久久免费视频色| 无码av中文一区二区三区桃花岛| 黄色成人免费在线| 在线日韩国产精品| 综合激情网...| 国产在线视频不卡二| 欧美日韩你懂得| 亚洲三级在线免费| 国产精品一区二区三区乱码| 欧美性色欧美a在线播放| 欧美国产日韩一二三区| 人人精品人人爱| 欧美日韩激情一区| 亚洲综合视频在线观看| 91啪亚洲精品| 亚洲激情网站免费观看| 国产激情偷乱视频一区二区三区| 精品久久一二三区| 日本色综合中文字幕| 91精品国产色综合久久不卡蜜臀| 亚洲欧美色综合| 91成人在线精品| 午夜精品久久久久| 日韩视频一区二区三区在线播放| 日韩中文字幕av电影| 91精品国产日韩91久久久久久| 午夜精品久久一牛影视| 欧美一区二区三区思思人| 久久精品国产成人一区二区三区| 日韩欧美在线网站| 激情综合色综合久久| 欧美大片日本大片免费观看| 婷婷开心激情综合| 精品国产乱码久久久久久久久| 99精品久久99久久久久| 精品一区二区在线观看| 欧美日韩一级片在线观看| 国产一区美女在线| 国产精品99久久久| 国内精品伊人久久久久av影院| 精品久久久影院| 色欧美乱欧美15图片| 麻豆精品蜜桃视频网站| 亚洲欧美日韩久久| 久久亚洲综合色一区二区三区| 国产东北露脸精品视频| 免费日本视频一区| 香港成人在线视频| 一区二区三区欧美在线观看| 精品精品国产高清a毛片牛牛| 欧美性欧美巨大黑白大战| 99久久精品久久久久久清纯| 国精品**一区二区三区在线蜜桃| 一区二区三区在线免费视频| 中文字幕欧美国产| 久久婷婷国产综合精品青草| 精品日韩99亚洲| 久久综合九色综合97_久久久| 欧美乱妇15p| 欧美一区二区观看视频| 日本道色综合久久| 欧美电影在线免费观看|