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

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

?? normalize.c

?? 貝葉斯學習算法分類文本。基于樸素貝葉斯分類器的文本分類的通用算法
?? C
字號:
/* Functions for normalizing weights in a bow_barrel *//* Copyright (C) 1997 Andrew McCallum   Written by:  Andrew Kachites McCallum <mccallum@cs.cmu.edu>   This file is part of the Bag-Of-Words Library, `libbow'.   This library is free software; you can redistribute it and/or   modify it under the terms of the GNU Library General Public License   as published by the Free Software Foundation, version 2.      This library is distributed in the hope that it will be useful,   but WITHOUT ANY WARRANTY; without even the implied warranty of   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU   Library General Public License for more details.   You should have received a copy of the GNU Library General Public   License along with this library; if not, write to the Free Software   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA */#include <bow/libbow.h>#if !HAVE_SQRTF#define sqrtf sqrt#endifstatic float_accumulate_for_vector_length (float total_so_far, float increment){  return (total_so_far + (increment * increment));}static float_finalize_for_vector_length (float total){  return (1.0 / sqrtf (total));}static float_accumulate_for_summing (float total_so_far, float increment){  return (total_so_far + increment);}static float_finalize_for_summing (float total){  return (1.0 / total);}/* Calculate the normalizing factor by which each weight should be    multiplied.  Store it in each cdoc->normalizer. */static void_bow_barrel_normalize_weights (bow_barrel *barrel,			       float (*accumulator)(float, float),			       float (*finalizer)(float))				    {  int current_di;		/* the index of the document for which				   we are currently normalizing the				   "word vector". */  float norm_total;		/* the length of the word vector */  float weight;			/* the weight of a single wi/di entry */  bow_dv_heap *heap;		/* a heap of "document vectors" */  bow_cdoc *cdoc;		/* The document we're working on */  heap = bow_make_dv_heap_from_wi2dvf (barrel->wi2dvf);  bow_verbosify (bow_progress, "Normalizing weights:          ");  /* Keep going until the heap is empty */  while (heap->length > 0)    {      /* Set the current document we're working on */      current_di = heap->entry[0].current_di;      assert (heap->entry[0].dv->idf == heap->entry[0].dv->idf);  /* NaN */      if (current_di % 10 == 0)	bow_verbosify (bow_progress, "\b\b\b\b\b\b%6d", current_di);      /* Here we should check if this di is part of some training set and	 move on if it isn't. */          /* Get the document */      cdoc = bow_cdocs_di2doc (barrel->cdocs, current_di);      /* If it's not a model document, then move on to next one */      if (cdoc->type != model)	{	  do 	    {	      bow_dv_heap_update (heap);	    }	  while ((current_di == heap->entry[0].current_di)		 && (heap->length > 0));	  	  /* Try again */	  continue;	}          /* Reset the length */      norm_total = 0.0;      /* Loop over all words in this document, summing up the score */      do 	{	  weight = heap->entry[0].dv->entry[heap->entry[0].index].weight;	  norm_total = (*accumulator)(norm_total, weight);	  /* Update the heap, we are done with this di, move it to its	     new position */	  bow_dv_heap_update (heap);	}       while ((current_di == heap->entry[0].current_di)	     && (heap->length > 0));      /* xxx Why isn't this always true? -am */      /* assert (norm_total != 0); */      /* Do final processing of, and store the result. */      cdoc->normalizer = (*finalizer)(norm_total);    }  /* xxx We could actually re-set the weights using the normalizer now     and avoid storing the normalizer.  This would be easier than     figuring out the normalizer, because we don't have to use the heap     again, we can just loop through all the WI's and DVI's. */  bow_free (heap);  bow_verbosify (bow_progress, "\n"); }/* Normalize the weight-vector for each class (or document) such that   all vectors have Euclidean length 1. */voidbow_barrel_normalize_weights_by_vector_length (bow_barrel *barrel){  _bow_barrel_normalize_weights (barrel, 				 _accumulate_for_vector_length,				 _finalize_for_vector_length);}/* Normalize the weight-vector for each class (or document) such that   in all vectors, the elements of the vector sum to 1. */voidbow_barrel_normalize_weights_by_summing (bow_barrel *barrel){  _bow_barrel_normalize_weights (barrel, 				 _accumulate_for_summing,				 _finalize_for_summing);}/* Assign a value to the "word vector's" NORMALIZER field, such that   when all the weights in the vector are multiplied by the   NORMALIZER, the Euclidian length of the vector will be one. */voidbow_wv_normalize_weights_by_vector_length (bow_wv *wv){  float total = 0.0f;  int wvi;  for (wvi = 0; wvi < wv->num_entries; wvi++)    total += wv->entry[wvi].weight * wv->entry[wvi].weight;  if (total == 0)    bow_error ("You forgot to set the weights before normalizing the WV.");  wv->normalizer = 1.0 / sqrtf (total);}/* Assign a value to the "word vector's" NORMALIZER field, such that   when all the weights in the vector are multiplied by the   NORMALIZER, all the vector entries will to one. */voidbow_wv_normalize_weights_by_summing (bow_wv *wv){  float total = 0.0f;  int wvi;  for (wvi = 0; wvi < wv->num_entries; wvi++)    total += wv->entry[wvi].weight;  if (total == 0)    bow_error ("You forgot to set the weights before normalizing the WV.");  wv->normalizer = 1.0 / total;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲男女一区二区三区| 91精品国产综合久久久久| 久久99久久久欧美国产| 亚洲亚洲人成综合网络| 亚洲黄色av一区| 亚洲免费色视频| 亚洲你懂的在线视频| 国产精品久久久久一区二区三区共| 欧美精品第1页| 日韩三级精品电影久久久 | 亚洲精品免费电影| 亚洲视频一区二区在线| 亚洲老妇xxxxxx| 亚洲国产精品天堂| 日韩精品电影在线| 久久成人久久鬼色| 成人美女在线视频| 在线观看网站黄不卡| 欧美日韩国产色站一区二区三区| 在线播放欧美女士性生活| 日韩午夜在线观看| 日本一区二区综合亚洲| 亚洲女厕所小便bbb| 日韩av一区二区三区四区| 秋霞午夜av一区二区三区| 国产最新精品免费| 波多野结衣中文字幕一区 | 欧美日韩国产欧美日美国产精品| 欧美日韩精品一区二区天天拍小说| 欧美日韩mp4| 久久久久久久精| 亚洲精品成人a在线观看| 亚洲午夜精品在线| 激情偷乱视频一区二区三区| 成人av在线播放网站| 欧美日韩一区二区在线观看视频 | 在线精品亚洲一区二区不卡| 9191精品国产综合久久久久久| 久久综合九色欧美综合狠狠| 亚洲天堂av一区| 久久国产剧场电影| 色综合欧美在线视频区| 精品国产青草久久久久福利| 亚洲免费在线观看视频| 国产剧情一区二区三区| 欧美午夜精品理论片a级按摩| 久久日韩精品一区二区五区| 亚洲黄网站在线观看| 国产成人在线网站| 欧美一区二区三区免费视频| 国产精品久久久久久久久免费桃花 | 国产三级一区二区| 日韩电影一二三区| 91激情五月电影| 国产日韩欧美精品综合| 日本成人中文字幕| 欧美亚洲综合色| 亚洲素人一区二区| 国产剧情一区二区| 欧美大度的电影原声| 亚洲第一av色| 欧美视频完全免费看| 亚洲婷婷国产精品电影人久久| 国产麻豆成人传媒免费观看| 欧美一区二区人人喊爽| 亚洲成人精品一区| 欧美日韩亚洲综合一区| 亚洲精品视频在线观看免费 | www.欧美精品一二区| 久久久亚洲国产美女国产盗摄| 日本视频中文字幕一区二区三区| 在线观看日韩国产| 亚洲激情自拍视频| 色综合网色综合| 亚洲精品五月天| 色欧美88888久久久久久影院| 中文字幕在线免费不卡| 成人午夜av电影| 国产精品素人一区二区| 成人av在线电影| ㊣最新国产の精品bt伙计久久| 成年人国产精品| 亚洲精品欧美激情| 欧美色电影在线| 调教+趴+乳夹+国产+精品| 欧美精选午夜久久久乱码6080| 日韩高清一级片| 欧美xxxxxxxx| 成人免费高清在线| 亚洲男同1069视频| 欧美日韩国产高清一区| 蜜桃久久av一区| 久久久99精品久久| 色综合久久久久久久久久久| 夜夜精品视频一区二区| 欧美高清视频不卡网| 精品一区二区三区视频| 国产精品午夜在线| 欧美日韩精品欧美日韩精品| 美女高潮久久久| 国产精品国产三级国产普通话三级| 色婷婷久久99综合精品jk白丝| 亚洲美女精品一区| 日韩欧美久久一区| 成人精品一区二区三区中文字幕| 一区二区在线电影| 26uuu久久天堂性欧美| av一本久道久久综合久久鬼色| 性久久久久久久久| 国产视频不卡一区| 欧美日本一区二区| 成人精品国产一区二区4080| 亚洲va韩国va欧美va| 久久久久久久久一| 欧美日韩一卡二卡| 国产成人av电影在线| 天天操天天色综合| 国产精品欧美经典| 日韩视频免费观看高清完整版 | 亚洲欧美影音先锋| 日韩欧美国产精品一区| 色八戒一区二区三区| 国产原创一区二区| 亚洲一区二区偷拍精品| 中日韩免费视频中文字幕| 91精品国产综合久久精品图片| 成人精品在线视频观看| 麻豆精品视频在线观看| 亚洲在线中文字幕| 国产精品乱码一区二三区小蝌蚪| 91精品福利在线一区二区三区| 色88888久久久久久影院按摩| 国产麻豆日韩欧美久久| 三级久久三级久久久| 亚洲精品乱码久久久久久久久| 国产欧美精品区一区二区三区| 日韩亚洲欧美中文三级| 欧美视频日韩视频| 色狠狠一区二区| 91性感美女视频| 成人美女视频在线观看18| 极品少妇xxxx精品少妇偷拍| 日韩精品久久久久久| 亚洲国产欧美在线人成| 1区2区3区欧美| 中文字幕色av一区二区三区| 国产欧美精品国产国产专区| 久久久久久久久伊人| 精品sm捆绑视频| 欧美精品一区二区三区久久久 | 国产裸体歌舞团一区二区| 欧美a级一区二区| 日本网站在线观看一区二区三区| 天天av天天翘天天综合网色鬼国产 | 国产成人免费在线视频| 国产乱码一区二区三区| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 日韩av一区二| 美女久久久精品| 韩国欧美国产一区| 国产成人在线电影| 92精品国产成人观看免费| 色94色欧美sute亚洲线路一ni| 色菇凉天天综合网| 欧美三级乱人伦电影| 7777精品伊人久久久大香线蕉的 | 丁香婷婷综合五月| 成人18视频日本| 在线观看av一区| 正在播放亚洲一区| 久久蜜桃av一区二区天堂| 欧美极品aⅴ影院| 一区二区视频在线| 日韩在线卡一卡二| 国产一区在线精品| 欧美日韩精品一区二区三区蜜桃 | 国产成人午夜精品影院观看视频| 成人一区二区三区视频在线观看 | 奇米精品一区二区三区四区| 激情欧美日韩一区二区| 成人性生交大片免费看视频在线| 色哟哟亚洲精品| 日韩欧美一区二区久久婷婷| 国产欧美一区二区在线观看| 一区二区三区四区五区视频在线观看 | av电影天堂一区二区在线观看| 色哟哟亚洲精品| 欧美tickle裸体挠脚心vk| 中文字幕成人av| 青青青伊人色综合久久| 成人性生交大片| 在线不卡中文字幕| 国产精品久久久一区麻豆最新章节| 亚洲高清视频在线| 成人动漫视频在线| 日韩免费看网站| 亚洲国产日韩a在线播放性色| 国产精品一二三区在线| 欧美日本在线看| **欧美大码日韩|