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

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

?? foilgain.c

?? 貝葉斯學習算法分類文本?;跇闼刎惾~斯分類器的文本分類的通用算法
?? C
字號:
/* Calculating Quinlan's Foil-gain */#include <bow/libbow.h>#if !HAVE_LOG2F#define log2f log#endif/* Return a malloc()'ed array containing an Foil-gain score for   each word-index for class CI.  BARREL must be a `doc_barrel' */float *bow_foilgain_ci_per_wi_new (bow_barrel *barrel, int ci,			    int num_classes, int *num_wi){  int max_wi = MIN (barrel->wi2dvf->size, bow_num_words());  float *fig_per_wi;		/* The return value */  int pos_per_ci;		/* This is p_0 in Tom's book */  int neg_per_ci;		/* This is n_0 in Tom's book */  int *pos_per_wi;		/* This is p_1 in Tom's book */  int *neg_per_wi;		/* This is n_1 in Tom's book */  int di;			/* a document index */  int wi;			/* a word index */  int dvi;  bow_cdoc *cdoc;  bow_dv *dv;  /* Use malloc() instead of alloca() because otherwise (I think) we     were running out of stack space. */  pos_per_wi = bow_malloc (max_wi * sizeof (int));  neg_per_wi = bow_malloc (max_wi * sizeof (int));    *num_wi = max_wi;  fig_per_wi = bow_malloc (max_wi * sizeof (float));  /* Initialize all the counts to zero. */  pos_per_ci = 0;  neg_per_ci = 0;  for (wi = 0; wi < max_wi; wi++)    {      pos_per_wi[wi] = 0;      neg_per_wi[wi] = 0;    }  /* Loop over all documents, incrementing {pos,neg}_per_ci counts. */  for (di = 0; di < barrel->cdocs->length; di++)    {      cdoc = bow_array_entry_at_index (barrel->cdocs, di);      /* This document is a positive instance of class CDOC->CLASS,	 and a negative instance of all other classes. */      if (cdoc->class == ci)	pos_per_ci++;      else	neg_per_ci++;    }  /* Loop over all words and document vectors, incremeting the     {pos,neg}_per_wi_ci counts. */  for (wi = 0; wi < max_wi; wi++)    {      dv = bow_wi2dvf_dv (barrel->wi2dvf, wi);      /* Deal with empty document vectors. */      if (!dv)	{	  /* There are no documents with word WI.  Increment	     our negative count for this WI/CI combination by the	     total number of documents. */	  neg_per_wi[wi] += barrel->cdocs->length;	  continue;	}      /* There are some documents containing this word, increment our	 negative count for this WI/CI combination by the number that	 are missing from the document vector DV. */      assert (barrel->cdocs->length - dv->length >= 0);      neg_per_wi[wi] += barrel->cdocs->length - dv->length;            /* Look at the classes of each of the documents in the document	 vector.  Increment the positive count for this WI/CI pair;	 also increment the WI negative count for the classes that	 each document is not. */      for (dvi = 0; dvi < dv->length; dvi++)	{	  cdoc = bow_array_entry_at_index (barrel->cdocs, dv->entry[dvi].di);	  /* This document is a positive instance of class CDOC->CLASS,	     and a negative instance of all other classes. */	  if (cdoc->class == ci)	    pos_per_wi[wi]++;	  else	    neg_per_wi[wi]++;	}    }  /* Fill in FIG_PER_WI_CI for each word/class combination. */  {    float bits_pre_split =      - (log2f (((float)pos_per_ci)		/ (pos_per_ci + neg_per_ci)));    assert (pos_per_ci + neg_per_ci > 0);    assert (bits_pre_split == bits_pre_split);    assert (bits_pre_split >= 0);    for (wi = 0; wi < max_wi; wi++)      {	if (pos_per_wi[wi] == 0)	  {	    fig_per_wi[wi] = 0;	  }	else	  {	    int gdb_pos = pos_per_wi[wi];	    int gdb_neg = neg_per_wi[wi];	    float bits_post_split = 	      - (log2f (((float)pos_per_wi[wi])			/ (pos_per_wi[wi] + neg_per_wi[wi])));	    fig_per_wi[wi] = 	      (pos_per_wi[wi] 	       * (bits_post_split - bits_pre_split));		 	    /* Catch cases in which it's NaN */	    assert (fig_per_wi[wi] == fig_per_wi[wi]);	    assert (gdb_pos + gdb_neg > 0);	  }      }  }  bow_free (pos_per_wi);  bow_free (neg_per_wi);  return fig_per_wi;}/* Return a malloc()'ed array containing an Foil-gain score for   each ``word-index / class pair''.  BARREL must be a `doc_barrel' */float **bow_foilgain_per_wi_ci_new (bow_barrel *barrel, int num_classes, int *num_wi){  int max_wi = MIN (barrel->wi2dvf->size, bow_num_words());  float **fig_per_wi_ci;		/* The return value */  int pos_per_ci[num_classes];	/* This is p_0 in Tom's book */  int neg_per_ci[num_classes];	/* This is n_0 in Tom's book */  int **pos_per_wi_ci;		/* This is p_1 in Tom's book */  int **neg_per_wi_ci;		/* This is n_1 in Tom's book */  int ci;			/* a class index */  int di;			/* a document index */  int wi;			/* a word index */  int dvi;  bow_cdoc *cdoc;  bow_dv *dv;  /* Use malloc() instead of alloca() because otherwise (I think) we     were running out of stack space. */  pos_per_wi_ci = bow_malloc (max_wi * sizeof (int*));  neg_per_wi_ci = bow_malloc (max_wi * sizeof (int*));  for (wi = 0; wi < max_wi; wi++)    {      pos_per_wi_ci[wi] = bow_malloc (num_classes * sizeof (int));      neg_per_wi_ci[wi] = bow_malloc (num_classes * sizeof (int));    }    *num_wi = max_wi;  fig_per_wi_ci = bow_malloc (max_wi * sizeof (float*));  for (wi = 0; wi < max_wi; wi++)    fig_per_wi_ci[wi] = malloc (num_classes * sizeof (float));  /* Initialize all the counts to zero. */  for (ci = 0; ci < num_classes; ci++)    {      pos_per_ci[ci] = 0;      neg_per_ci[ci] = 0;      for (wi = 0; wi < max_wi; wi++)	{	  pos_per_wi_ci[wi][ci] = 0;	  neg_per_wi_ci[wi][ci] = 0;	}    }  /* Loop over all documents, incrementing {pos,neg}_per_ci counts. */  for (di = 0; di < barrel->cdocs->length; di++)    {      cdoc = bow_array_entry_at_index (barrel->cdocs, di);      /* This document is a positive instance of class CDOC->CLASS,	 and a negative instance of all other classes. */      for (ci = 0; ci < num_classes; ci++)	{	  if (cdoc->class == ci)	    pos_per_ci[ci]++;	  else	    neg_per_ci[ci]++;	}    }  /* Loop over all words and document vectors, incremeting the     {pos,neg}_per_wi_ci counts. */  for (wi = 0; wi < max_wi; wi++)    {      dv = bow_wi2dvf_dv (barrel->wi2dvf, wi);      /* Deal with empty document vectors. */      if (!dv)	{	  /* There are no documents with word WI.  Increment	     our negative count for this WI/CI combination by the	     total number of documents. */	  for (ci = 0; ci < num_classes; ci++)	    neg_per_wi_ci[wi][ci] += barrel->cdocs->length;	  continue;	}      /* There are some documents containing this word, increment our	 negative count for this WI/CI combination by the number that	 are missing from the document vector DV. */      for (ci = 0; ci < num_classes; ci++)	{	  assert (barrel->cdocs->length - dv->length >= 0);	  neg_per_wi_ci[wi][ci] += barrel->cdocs->length - dv->length;	}            /* Look at the classes of each of the documents in the document	 vector.  Increment the positive count for this WI/CI pair;	 also increment the WI negative count for the classes that	 each document is not. */      for (dvi = 0; dvi < dv->length; dvi++)	{	  cdoc = bow_array_entry_at_index (barrel->cdocs, dv->entry[dvi].di);	  /* This document is a positive instance of class CDOC->CLASS,	     and a negative instance of all other classes. */	  for (ci = 0; ci < num_classes; ci++)	    {	      if (cdoc->class == ci)		pos_per_wi_ci[wi][ci]++;	      else		neg_per_wi_ci[wi][ci]++;	    }      }    }  /* Fill in FIG_PER_WI_CI for each word/class combination. */  for (ci = 0; ci < num_classes; ci++)    {      float bits_pre_split =	- (log2f (((float)pos_per_ci[ci])		  / (pos_per_ci[ci] + neg_per_ci[ci])));      assert (pos_per_ci[ci] + neg_per_ci[ci] > 0);      assert (bits_pre_split == bits_pre_split);      assert (bits_pre_split >= 0);      for (wi = 0; wi < max_wi; wi++)	{	  if (pos_per_wi_ci[wi][ci] == 0)	    {	      fig_per_wi_ci[wi][ci] = 0;	    }	  else	    {	      int gdb_pos = pos_per_wi_ci[wi][ci];	      int gdb_neg = neg_per_wi_ci[wi][ci];	      float bits_post_split = 		- (log2f (((float)pos_per_wi_ci[wi][ci])			  / (pos_per_wi_ci[wi][ci] + neg_per_wi_ci[wi][ci])));	      fig_per_wi_ci[wi][ci] = 		(pos_per_wi_ci[wi][ci] 		 * (bits_post_split - bits_pre_split));		 	      /* Catch cases in which it's NaN */	      assert (fig_per_wi_ci[wi][ci] == fig_per_wi_ci[wi][ci]);	      assert (gdb_pos + gdb_neg > 0);	    }	}    }  for (wi = 0; wi < max_wi; wi++)    {      bow_free (pos_per_wi_ci[wi]);      bow_free (neg_per_wi_ci[wi]);    }  bow_free (pos_per_wi_ci);  bow_free (neg_per_wi_ci);  return fig_per_wi_ci;}/* Free the memory allocated in the return value of the function   bow_foilgain_per_wi_ci_new() */voidbow_foilgain_free (float **fig_per_wi_ci, int num_wi){  int wi;  for (wi = 0; wi < num_wi; wi++)    bow_free (fig_per_wi_ci[wi]);  bow_free (fig_per_wi_ci);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
天天av天天翘天天综合网色鬼国产| 免费高清不卡av| 亚洲高清一区二区三区| 狂野欧美性猛交blacked| 99re66热这里只有精品3直播 | 日韩av一二三| 成人伦理片在线| 日韩欧美国产小视频| 亚洲综合在线电影| 成人免费视频视频| 精品久久久久久久久久久久久久久久久 | 一区二区国产盗摄色噜噜| 精品一区二区三区在线播放视频| 欧美中文字幕一区| 自拍偷拍欧美精品| 国产成人午夜片在线观看高清观看| 欧美蜜桃一区二区三区| 亚洲欧美一区二区三区久本道91| 国产伦精品一区二区三区视频青涩 | 欧美精品乱码久久久久久按摩| 国产精品污污网站在线观看| 美日韩一区二区| 8x8x8国产精品| 亚洲国产精品一区二区www| www.亚洲激情.com| 国产蜜臀av在线一区二区三区| 免费美女久久99| 欧美日韩中文另类| 亚洲韩国一区二区三区| 在线视频一区二区三| 一区二区三区丝袜| 在线观看av不卡| 一区二区三区在线不卡| 91久久奴性调教| 一区二区在线电影| 欧美在线一区二区三区| 亚洲一区在线观看免费 | 欧美国产成人在线| 国产91精品一区二区麻豆网站| 久久午夜色播影院免费高清| 国产精品一区二区91| 久久久久成人黄色影片| 丁香天五香天堂综合| 国产精品久久久久影院亚瑟| 97久久久精品综合88久久| 亚洲欧美国产毛片在线| 在线欧美一区二区| 日本欧美在线观看| 欧美精品一区二区三区在线| 国产一区二区导航在线播放| 欧美激情一区二区三区蜜桃视频| 国产99久久久精品| 亚洲欧美成人一区二区三区| 欧美私模裸体表演在线观看| 日本不卡在线视频| 久久久99久久精品欧美| 风间由美一区二区三区在线观看 | 日韩三级视频在线看| 国产中文字幕精品| 成人黄色网址在线观看| 成人午夜精品一区二区三区| 国产亚洲欧美日韩在线一区| 成人白浆超碰人人人人| 亚洲欧美激情小说另类| 91精品国产综合久久精品app | 日韩欧美在线网站| 国产成人亚洲综合a∨猫咪| 自拍偷拍国产亚洲| 欧美精品777| 夫妻av一区二区| 香蕉成人啪国产精品视频综合网| 中文字幕不卡在线播放| 国产91精品一区二区麻豆亚洲| 欧美xxxxxxxxx| 成人精品鲁一区一区二区| 一区二区三区免费在线观看| 日韩西西人体444www| 成人黄色综合网站| 日韩电影在线看| 中文字幕在线免费不卡| 欧美一级高清大全免费观看| 成人av午夜电影| 麻豆精品在线视频| 一区二区三区av电影 | 欧美三级在线播放| 国产91综合一区在线观看| 五月天丁香久久| 亚洲欧美另类久久久精品| 久久久综合激的五月天| 欧美久久免费观看| 91麻豆免费视频| 国产黄色成人av| 久久精品国产秦先生| 亚洲第一av色| 亚洲综合色婷婷| 中文字幕一区二区三区乱码在线 | 中文字幕佐山爱一区二区免费| 欧美日韩免费高清一区色橹橹 | 精品久久久久久久人人人人传媒| 色婷婷av一区二区三区gif| 国产综合久久久久影院| 日韩一区精品字幕| 亚洲影视资源网| 自拍视频在线观看一区二区| 国产精品色噜噜| 精品国产乱码久久久久久久久| 精品视频1区2区| 日本久久一区二区三区| 99精品视频中文字幕| 大桥未久av一区二区三区中文| 国产一区在线看| 精品一区二区三区免费视频| 中文字幕av不卡| 亚洲一区二区精品久久av| 国产婷婷色一区二区三区在线| 日韩精品一区二区三区swag| 欧美一区二区私人影院日本| 欧美日本一区二区三区四区| 精品污污网站免费看| 欧美日韩亚洲丝袜制服| 欧美日韩一区视频| 欧美精品精品一区| 欧美一区二区三区在线电影| 制服丝袜日韩国产| 日韩一区二区免费在线观看| 欧美一区二区三区啪啪| 欧美一区二区三区四区在线观看| 欧美肥妇毛茸茸| 日韩午夜在线观看| 久久久99精品免费观看不卡| 日本一区二区电影| 亚洲视频一区在线观看| 亚洲美腿欧美偷拍| 日韩电影在线一区二区三区| 久久99热99| 成人性视频免费网站| 99精品久久久久久| 欧美日韩极品在线观看一区| 欧美一区二区国产| 久久久精品欧美丰满| 综合久久久久久| 亚洲成人一二三| 国产一区二区三区在线观看免费 | 欧美一区二区不卡视频| 欧美成人女星排行榜| 精品福利视频一区二区三区| 日本一区二区在线不卡| 一区二区三区视频在线看| 日韩成人av影视| 国产成人超碰人人澡人人澡| 欧洲中文字幕精品| 日韩欧美二区三区| 中文字幕综合网| 美腿丝袜一区二区三区| 9人人澡人人爽人人精品| 欧美巨大另类极品videosbest| 中文字幕一区二区三区在线观看| 亚洲欧美日韩国产中文在线| 久久国产精品色婷婷| 91蜜桃在线观看| 精品国产一二三| 亚洲线精品一区二区三区八戒| 国产一区亚洲一区| 国产欧美日韩在线观看| 国产精品久久久久四虎| 日本伊人色综合网| av午夜一区麻豆| 日韩欧美成人激情| 亚洲一区二区三区免费视频| 岛国精品一区二区| 日韩美女一区二区三区四区| 亚洲精品久久久蜜桃| 国产91精品一区二区麻豆网站| 5月丁香婷婷综合| 亚洲日本在线a| 高清不卡在线观看av| 日韩欧美一区在线| 亚洲国产成人精品视频| www.av精品| 欧美国产激情一区二区三区蜜月| 日韩影视精彩在线| 欧美少妇性性性| 成人免费在线视频观看| 国产iv一区二区三区| 欧美精品一区二区久久久| 日韩激情视频在线观看| 欧美日免费三级在线| 亚洲视频在线一区二区| 成人av动漫网站| 日本一区二区电影| 国产一区二区导航在线播放| 欧美电视剧在线看免费| 偷拍一区二区三区四区| 欧美性猛交xxxx乱大交退制版| 亚洲欧美国产毛片在线| 色综合天天综合在线视频| 日韩一区有码在线| 91亚洲大成网污www| 亚洲同性gay激情无套| 91最新地址在线播放|