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

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

?? npi.c

?? Programs to induce a naive possibilistic classifier (a possibilistic analog of the naive Bayes class
?? C
字號:
/*----------------------------------------------------------------------  File    : npi.c  Contents: naive possibilistic classifier induction  Author  : Christian Borgelt  History : 07.02.2001 file created from file nbi.c            17.07.2001 adapted to modified module scan            16.08.2003 slight changes in error message output----------------------------------------------------------------------*/#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <string.h>#include <assert.h>#ifndef AS_RDWR#define AS_RDWR#endif#ifndef AS_PARSE#define AS_PARSE#endif#ifndef TAB_RDWR#define TAB_RDWR#endif#include "io.h"#ifndef NPC_INDUCE#define NPC_INDUCE#endif#include "nposs.h"#ifdef STORAGE#include "storage.h"#endif/*----------------------------------------------------------------------  Preprocessor Definitions----------------------------------------------------------------------*/#define PRGNAME     "npi"#define DESCRIPTION "naive possibilistic classifier induction"#define VERSION     "version 1.6 (2004.08.12)         " \                    "(c) 1999-2004   Christian Borgelt"/* --- error codes --- */#define OK            0         /* no error */#define E_NONE        0         /* no error */#define E_NOMEM     (-1)        /* not enough memory */#define E_FOPEN     (-2)        /* file open failed */#define E_FREAD     (-3)        /* file read failed */#define E_FWRITE    (-4)        /* file write failed */#define E_OPTION    (-5)        /* unknown option */#define E_OPTARG    (-6)        /* missing option argument */#define E_ARGCNT    (-7)        /* wrong number of arguments */#define E_STDIN     (-8)        /* double assignment of stdin */#define E_PARSE     (-9)        /* parse error */#define E_SIMP     (-10)        /* unknown simplification mode */#define E_CLASS    (-11)        /* missing class */#define E_CTYPE    (-12)        /* class is not symbolic */#define E_UNKNOWN  (-13)        /* unknown error *//*----------------------------------------------------------------------  Constants----------------------------------------------------------------------*/static const char *errmsgs[] = {   /* error messages */  /* E_NONE      0 */  "no error\n",  /* E_NOMEM    -1 */  "not enough memory\n",  /* E_FOPEN    -2 */  "cannot open file `%s'\n",  /* E_FREAD    -3 */  "read error on file `%s'\n",  /* E_FWRITE   -4 */  "write error on file `%s'\n",  /* E_OPTION   -5 */  "unknown option -%c\n",  /* E_OPTARG   -6 */  "missing option argument\n",  /* E_ARGCNT   -7 */  "wrong number of arguments\n",  /* E_STDIN    -8 */  "double assignment of standard input\n",  /* E_PARSE    -9 */  "parse error(s) on file `%s'\n",  /* E_SIMP    -10 */  "unknown simplification mode %c\n",  /* E_CLASS   -11 */  "missing class `%s' in file `%s'\n",  /* E_CTYPE   -12 */  "class `%s' is not symbolic\n",  /* E_UNKNOWN -13 */  "unknown error\n"};/*----------------------------------------------------------------------  Global Variables----------------------------------------------------------------------*/const  char   *prgname = NULL;  /* program name for error messages */static SCAN   *scan    = NULL;  /* scanner */static ATTSET *attset  = NULL;  /* attribute set */static TABLE  *table   = NULL;  /* table */static NPC    *npc     = NULL;  /* naive possibilistic classifier */static FILE   *in      = NULL;  /* input  file */static FILE   *out     = NULL;  /* output file *//*----------------------------------------------------------------------  Functions----------------------------------------------------------------------*/static void error (int code, ...){                               /* --- print error message */  va_list    args;              /* list of variable arguments */  const char *msg;              /* error message */  assert(prgname);              /* check the program name */  if (code < E_UNKNOWN) code = E_UNKNOWN;  if (code < 0) {               /* if to report an error, */    msg = errmsgs[-code];       /* get the error message */    if (!msg) msg = errmsgs[-E_UNKNOWN];    fprintf(stderr, "\n%s: ", prgname);    va_start(args, code);       /* get variable arguments */    vfprintf(stderr, msg, args);/* print the error message */    va_end(args);               /* end argument evaluation */  }  #ifndef NDEBUG  if (npc)    npc_delete(npc, 0);  if (attset) as_delete(attset);  if (table)  tab_delete(table, 0);  /* clean up memory */  if (scan)   sc_delete(scan);       /* and close files */  if (in  && (in  != stdin))  fclose(in);  if (out && (out != stdout)) fclose(out);  #endif  #ifdef STORAGE  showmem("at end of program"); /* check memory usage */  #endif  exit(code);                   /* abort the program */}  /* error() *//*--------------------------------------------------------------------*/int main (int argc, char *argv[]){                               /* --- main function */  int    i, k = 0;              /* loop variables, counter */  char   *s;                    /* to traverse options */  char   **optarg = NULL;       /* option argument */  char   *fn_hdr  = NULL;       /* name of table header file */  char   *fn_tab  = NULL;       /* name of table file */  char   *fn_dom  = NULL;       /* name of domain file */  char   *fn_npc  = NULL;       /* name of classifier file */  char   *blanks  = NULL;       /* blanks */  char   *fldseps = NULL;       /* field  separators */  char   *recseps = NULL;       /* record separators */  char   *uvchars = NULL;       /* unknown value characters */  char   *clscol  = NULL;       /* class column name */  int    flags    = AS_NOXATT;  /* table file read flags */  int    simp     = 0;          /* flag for classifier simplification */  int    imode    = 0;          /* induction   mode */  int    dmode    = 0;          /* description mode */  int    maxlen   = 0;          /* maximal output line length */  int    attcnt   = 0;          /* number of attributes */  double tplwgt   = 0.0;        /* weight of tuples */  int    clsid;                 /* id of class column */  ATT    *att;                  /* to traverse attributes */  prgname = argv[0];            /* get program name for error msgs. */  /* --- print startup/usage message --- */  if (argc > 1) {               /* if arguments are given */    fprintf(stderr, "%s - %s\n", argv[0], DESCRIPTION);    fprintf(stderr, VERSION); } /* print a startup message */  else {                        /* if no argument given */    printf("usage: %s [options] domfile "                     "[-d|-h hdrfile] tabfile nbcfile\n", argv[0]);    printf("%s\n", DESCRIPTION);    printf("%s\n", VERSION);    printf("-c#      class field name (default: last field)\n");    printf("-s#      simplify classifier a: by adding, "                    "r: by removing attributes\n");    printf("-p       print degrees of possibility (in percent)\n");    printf("-l#      output line length (default: no limit)\n");    printf("-b/f/r#  blanks, field and record separators "                    "(default: \" \\t\", \" \\t\", \"\\n\")\n");    printf("-u#      unknown value characters (default: \"?\")\n");    printf("-n       number of tuple occurrences in last field\n");    printf("domfile  file containing domain descriptions\n");    printf("-d       use default table header "                    "(field names = field numbers)\n");    printf("-h       read table header (field names) from hdrfile\n");    printf("hdrfile  file containing table header (field names)\n");    printf("tabfile  table file to read "                    "(field names in first record)\n");    printf("npcfile  file to write naive possibilistic "                    "classifier to\n");    return 0;                   /* print a usage message */  }                             /* and abort the program */  /* --- evaluate arguments --- */  for (i = 1; i < argc; i++) {  /* traverse arguments */    s = argv[i];                /* get option argument */    if (optarg) { *optarg = s; optarg = NULL; continue; }    if ((*s == '-') && *++s) {  /* -- if argument is an option */      while (1) {               /* traverse characters */        switch (*s++) {         /* evaluate option */          case 'c': optarg  = &clscol;               break;          case 's': simp    = (*s) ? *s++ : 0;       break;          case 'p': dmode  |= NPC_POSS;              break;          case 'l': maxlen  = (int)strtol(s, &s, 0); break;          case 'b': optarg  = &blanks;               break;          case 'f': optarg  = &fldseps;              break;          case 'r': optarg  = &recseps;              break;          case 'u': optarg  = &uvchars;              break;          case 'n': flags  |= AS_WEIGHT;             break;          case 'd': flags  |= AS_DFLT;               break;          case 'h': optarg  = &fn_hdr;               break;          default : error(E_OPTION, *--s);           break;        }                       /* set option variables */        if (!*s) break;         /* if at end of string, abort loop */        if (optarg) { *optarg = s; optarg = NULL; break; }      } }                       /* get option argument */    else {                      /* -- if argument is no option */      switch (k++) {            /* evaluate non-option */        case  0: fn_dom = s;      break;        case  1: fn_tab = s;      break;        case  2: fn_npc = s;      break;        default: error(E_ARGCNT); break;      }                         /* note filenames */    }  }  if (optarg) error(E_OPTARG);  /* check the option argument */  if (k != 3) error(E_ARGCNT);  /* and the number of arguments */  if (fn_hdr && (strcmp(fn_hdr, "-") == 0))    fn_hdr = "";                /* convert "-" to "" */  i = (!fn_dom || !*fn_dom) ? 1 : 0;  if  (!fn_tab || !*fn_tab) i++;  if  ( fn_hdr && !*fn_hdr) i++;/* check assignments of stdin */  if (i > 1) error(E_STDIN);    /* stdin must not be used twice */  if      (simp == 'a') imode |= NPC_ADD;  else if (simp == 'r') imode |= NPC_REMOVE;  else if (simp !=  0 )         /* check simplification mode */    error(E_SIMP, simp);        /* (must be 'add' or 'remove') */  if (fn_hdr)                   /* set the header file flag */    flags = AS_ATT | (flags & ~AS_DFLT);  /* --- read attribute set --- */  scan = sc_create(fn_dom);     /* create a scanner */  if (!scan) error((!fn_dom || !*fn_dom) ? E_NOMEM : E_FOPEN, fn_dom);  attset = as_create("domains", att_delete);  if (!attset) error(E_NOMEM);  /* create an attribute set */  fprintf(stderr, "\nreading %s ... ", sc_fname(scan));  if ((sc_nexter(scan)   <  0)  /* start scanning (get first token) */  ||  (as_parse(attset, scan, AT_ALL) != 0)  ||  (as_attcnt(attset) <= 0)  /* parse attribute set and */  ||  !sc_eof(scan))            /* check for end of file */    error(E_PARSE, sc_fname(scan));  sc_delete(scan); scan = NULL; /* delete the scanner */  attcnt = as_attcnt(attset);   /* get and print the number of atts. */  fprintf(stderr, "[%d attribute(s)] done.\n", attcnt);  /* --- determine id of class column --- */  if (!clscol)                  /* if no class column name given, */    clsid = attcnt -1;          /* use the last column as the class */  else {                        /* if a class column name given */    clsid = as_attid(attset, clscol);    if (clsid < 0) error(E_CLASS, clscol, fn_dom);  }                             /* check whether class exists */  att = as_att(attset, clsid);  /* get the class attribute */  if (att_type(att) != AT_SYM)  /* check the type of the class */    error(E_CTYPE, att_name(att));       /* (must be symbolic) */  /* --- read table header --- */  as_chars(attset, blanks, fldseps, recseps, uvchars);  in = io_hdr(attset, fn_hdr, fn_tab, flags, 1);  if (!in) error(1);            /* read the table header */  /* --- construct naive possibilistic classifier --- */  table = io_bodyin(attset, in, fn_tab, flags, "table", 1);  if (!table) error(1);       /* read the table body */  fprintf(stderr, "reducing table ... ");  tab_reduce(table);          /* reduce table for speed up */  tplwgt = tab_getwgt(table, 0, INT_MAX);  fprintf(stderr, "[%d/", tab_tplcnt(table));  fprintf(stderr, "%g tuple(s)] done.\n", tplwgt);  fprintf(stderr, "building classifier ... ");  npc = npc_induce(table, clsid, imode);  if (!npc) error(E_NOMEM);     /* induce a possibilistic classifier */  attcnt = npc_mark(npc);       /* and mark the selected attributes */  fprintf(stderr, "done.\n");   /* print a success message */  /* --- describe created classifier --- */  if (fn_npc && *fn_npc)        /* if an output file name is given, */    out = fopen(fn_npc, "w");   /* open output file for writing */  else {                        /* if no output file name is given, */    out = stdout; fn_npc = "<stdout>"; }         /* write to stdout */  fprintf(stderr, "writing %s ... ", fn_npc);  if (!out) error(E_FOPEN, fn_npc);  k = (simp) ? AS_MARKED : 0;   /* print only class and marked atts. */  if (as_desc(attset, out, k|AS_TITLE, maxlen) != 0)    error(E_FWRITE, fn_npc);    /* describe attribute domains */  fputc('\n', out);             /* leave one line empty */  if (npc_desc(npc, out, dmode|NPC_TITLE, maxlen) != 0)    error(E_FWRITE, fn_npc);    /* describe possibilistic classifier */  if (maxlen <= 0) maxlen = 72; /* determine maximal line length */  fputs("\n/*", out);           /* append additional information */  for (k = maxlen -2; --k >= 0; ) fputc('-', out);  fprintf(out, "\n  number of attributes: %d",   attcnt);  fprintf(out, "\n  number of tuples    : %g\n", tplwgt);  for (k = maxlen -2; --k >= 0; ) fputc('-', out);  fputs("*/\n", out);           /* terminate additional information */  if (out != stdout) {          /* if not written to stdout, */    k = fclose(out); out = NULL;/* close the output file */    if (k) error(E_FWRITE, fn_npc);  }                             /* print a success message */  fprintf(stderr, "[%d attribute(s)] done.\n", attcnt);  /* --- clean up --- */  #ifndef NDEBUG  if (table) tab_delete(table, 0);  /* delete table, */  npc_delete(npc, 1);               /* possibilistic classifier, */  #endif                            /* and underlying attribute set */  #ifdef STORAGE  showmem("at end of program"); /* check memory usage */  #endif  return 0;                     /* return 'ok' */}  /* main() */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线电影一区二区三区| 亚洲欧美另类图片小说| 国产精品久久久久影院亚瑟 | 99久久久精品| 欧美一区二区三区在线观看| 日韩伦理电影网| 国产一区二区三区四| 欧美午夜精品一区| 中文字幕在线观看一区| 激情伊人五月天久久综合| 91久久奴性调教| 国产精品网站在线播放| 国产乱一区二区| 国产视频911| 亚洲成人免费电影| 在线亚洲免费视频| 亚洲欧洲制服丝袜| 成人激情免费网站| 久久久99久久| 国产一区二区视频在线播放| 91麻豆精品久久久久蜜臀 | 不卡视频一二三| 久久久久久毛片| 久久se这里有精品| 亚洲精品一区二区精华| 美腿丝袜亚洲一区| 日韩一级黄色大片| 久88久久88久久久| 精品理论电影在线观看| 久久国产成人午夜av影院| 91精品久久久久久久久99蜜臂| 亚洲国产三级在线| 欧美日本视频在线| 青青草97国产精品免费观看无弹窗版| 欧美日韩视频不卡| 日本美女视频一区二区| 欧美巨大另类极品videosbest | 成人av高清在线| 亚洲图片欧美视频| 欧美电影一区二区| 另类专区欧美蜜桃臀第一页| 精品区一区二区| 国产精品白丝av| 综合色天天鬼久久鬼色| 91黄色小视频| 日韩电影免费在线| 亚洲精品在线电影| 成人av免费观看| 亚洲地区一二三色| 日韩一级片网址| 国产成人精品影院| 一区二区三区在线不卡| 欧美肥妇毛茸茸| 国产成人精品网址| 亚洲黄色免费电影| 欧美男同性恋视频网站| 国产专区欧美精品| 成人免费一区二区三区在线观看| 在线观看日韩毛片| 美脚の诱脚舐め脚责91| 国产精品免费网站在线观看| 在线观看中文字幕不卡| 久久99久久精品欧美| 国产精品久久久久久久久免费桃花 | 国产精品资源在线观看| 中文字幕中文字幕一区二区| 欧美亚男人的天堂| 国产乱色国产精品免费视频| 亚洲免费伊人电影| 欧美mv日韩mv国产| 91久久人澡人人添人人爽欧美 | 国产精品一区免费视频| 亚洲色图制服丝袜| 精品国产免费人成电影在线观看四季| 成人午夜私人影院| 欧美aaa在线| 亚洲人精品一区| 久久综合五月天婷婷伊人| 99视频精品在线| 狠狠色丁香久久婷婷综| 亚洲制服丝袜一区| 国产精品电影院| 欧美v国产在线一区二区三区| 97精品电影院| 国产一区二区三区国产| 五月综合激情婷婷六月色窝| 欧美国产精品一区二区三区| 这里只有精品电影| 91官网在线观看| 成人av资源在线| 精一区二区三区| 日本免费在线视频不卡一不卡二 | 波多野结衣91| 国产在线一区二区| 日韩av在线发布| 一区二区三区成人| 中文字幕一区二区三区色视频| 日韩免费观看2025年上映的电影| 91高清视频在线| 在线区一区二视频| 日本韩国一区二区三区| av资源站一区| jvid福利写真一区二区三区| 国产精品影视天天线| 韩国欧美国产1区| 免费人成精品欧美精品| 亚洲制服丝袜一区| 一区二区在线观看视频| 亚洲欧美日韩一区| 亚洲精品国产a久久久久久| 国产精品国产三级国产aⅴ中文| 久久久久国产成人精品亚洲午夜| 欧美成人video| 久久亚洲一区二区三区四区| 欧美大片在线观看| 久久女同互慰一区二区三区| 精品免费日韩av| 久久综合久久久久88| 欧美精品一区二| 国产亚洲精久久久久久| 国产精品午夜免费| 一区在线观看视频| 亚洲另类在线一区| 亚洲成a人在线观看| 日韩成人伦理电影在线观看| 日韩精品1区2区3区| 激情综合一区二区三区| 国产精品一级在线| 91亚洲大成网污www| 欧美亚洲一区三区| 日韩美一区二区三区| 久久久久久久精| 亚洲视频一区在线观看| 午夜视频在线观看一区二区| 美女视频网站久久| 国产精品综合av一区二区国产馆| 风间由美一区二区av101| 91在线视频免费观看| 欧美色图免费看| 精品99一区二区三区| 中文字幕亚洲成人| 婷婷开心激情综合| 国产精品1024久久| 欧美性xxxxxxxx| 精品区一区二区| 专区另类欧美日韩| 日韩av一级片| 成人午夜av电影| 欧美欧美欧美欧美| 国产精品理论在线观看| 亚洲成年人影院| 成人免费视频免费观看| 欧美亚洲国产一卡| 久久综合资源网| 午夜在线电影亚洲一区| 国产老女人精品毛片久久| 在线免费观看日本一区| 久久久五月婷婷| 石原莉奈一区二区三区在线观看| 国产99久久久国产精品潘金| 欧美私人免费视频| 中文字幕在线观看一区二区| 奇米精品一区二区三区四区 | 九九视频精品免费| 在线免费亚洲电影| 欧美国产精品v| 美女高潮久久久| 欧美亚洲国产一区二区三区 | 成人综合婷婷国产精品久久 | 91丨九色丨蝌蚪丨老版| 欧美电影免费观看完整版| 亚洲自拍偷拍网站| 成人app下载| www国产精品av| 免费看日韩a级影片| 在线观看区一区二| 中文字幕制服丝袜一区二区三区 | 精品福利av导航| 亚洲风情在线资源站| 99国内精品久久| 欧美经典一区二区| 国产精品一区三区| 精品久久久久久久久久久院品网| 五月开心婷婷久久| 色一情一伦一子一伦一区| 欧美国产乱子伦| 丰满放荡岳乱妇91ww| 久久日韩粉嫩一区二区三区| 久久99精品国产.久久久久久| 欧美剧情电影在线观看完整版免费励志电影 | 在线观看视频91| 亚洲精品ww久久久久久p站| 99久久综合99久久综合网站| 国产欧美日韩综合| 国产suv精品一区二区6| 国产欧美一区二区在线| 成人黄色国产精品网站大全在线免费观看| 欧美mv和日韩mv的网站| 国产在线精品一区二区三区不卡| 欧美va亚洲va国产综合|