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

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

?? besttree.c

?? 決策樹是用二叉樹形圖來表示處理邏輯的一種工具。可以直觀、清晰地表達加工的邏輯要求。特別適合于判斷因素比較少、邏輯組合關系不復雜的情況。
?? C
字號:
/*************************************************************************//*									 *//*	Routines to manage tree growth, pruning and evaluation		 *//*	------------------------------------------------------		 *//*									 *//*************************************************************************/#include "defns.i"#include "types.i"#include "extern.i"ItemNo		*TargetClassFreq;Tree		*Raw;extern Tree	*Pruned;/*************************************************************************//*									 *//*	Grow and prune a single tree from all data			 *//*									 *//*************************************************************************/    OneTree()/*  ---------  */{    Tree FormTree(), CopyTree();    Boolean Prune();    InitialiseTreeData();    InitialiseWeights();    Raw = (Tree *) calloc(1, sizeof(Tree));    Pruned = (Tree *) calloc(1, sizeof(Tree));    AllKnown = true;    Raw[0] = FormTree(0, MaxItem);    printf("\n");    PrintTree(Raw[0]);    SaveTree(Raw[0], ".unpruned");    Pruned[0] = CopyTree(Raw[0]);    if ( Prune(Pruned[0]) )    {	printf("\nSimplified ");	PrintTree(Pruned[0]);    }}/*************************************************************************//*									 *//*	Grow and prune TRIALS trees and select the best of them		 *//*									 *//*************************************************************************/short BestTree()/*    --------  */{    Tree CopyTree(), Iterate();    Boolean Prune();    short t, Best=0;    InitialiseTreeData();    TargetClassFreq = (ItemNo *) calloc(MaxClass+1, sizeof(ItemNo));    Raw    = (Tree *) calloc(TRIALS, sizeof(Tree));    Pruned = (Tree *) calloc(TRIALS, sizeof(Tree));    /*  If necessary, set initial size of window to 20% (or twice	the sqrt, if this is larger) of the number of data items,	and the maximum number of items that can be added to the	window at each iteration to 20% of the initial window size  */    if ( ! WINDOW )    {	WINDOW = Max(2 * sqrt(MaxItem+1.0), (MaxItem+1) / 5);    }    if ( ! INCREMENT )    {	INCREMENT = Max(WINDOW / 5, 1);    }    FormTarget(WINDOW);    /*  Form set of trees by iteration and prune  */    ForEach(t, 0, TRIALS-1 )    {        FormInitialWindow();	printf("\n--------\nTrial %d\n--------\n\n", t);	Raw[t] = Iterate(WINDOW, INCREMENT);	printf("\n");	PrintTree(Raw[t]);	SaveTree(Raw[t], ".unpruned");	Pruned[t] = CopyTree(Raw[t]);	if ( Prune(Pruned[t]) )	{	    printf("\nSimplified ");	    PrintTree(Pruned[t]);	}	if ( Pruned[t]->Errors < Pruned[Best]->Errors )	{	    Best = t;	}    }    printf("\n--------\n");    return Best;}/*************************************************************************//*									 *//*  The windowing approach seems to work best when the class		 *//*  distribution of the initial window is as close to uniform as	 *//*  possible.  FormTarget generates this initial target distribution,	 *//*  setting up a TargetClassFreq value for each class.			 *//*									 *//*************************************************************************/    FormTarget(Size)/*  -----------  */    ItemNo Size;{    ItemNo i, *ClassFreq;    ClassNo c, Smallest, ClassesLeft=0;    ClassFreq = (ItemNo *) calloc(MaxClass+1, sizeof(ItemNo));    /*  Generate the class frequency distribution  */    ForEach(i, 0, MaxItem)    {	ClassFreq[ Class(Item[i]) ]++;    }    /*  Calculate the no. of classes of which there are items  */    ForEach(c, 0, MaxClass)    {	if ( ClassFreq[c] )	{	    ClassesLeft++;	}	else	{	    TargetClassFreq[c] = 0;	}    }    while ( ClassesLeft )    {	/*  Find least common class of which there are some items  */	Smallest = -1;	ForEach(c, 0, MaxClass)	{	    if ( ClassFreq[c] &&		 ( Smallest < 0 || ClassFreq[c] < ClassFreq[Smallest] ) )	    {		Smallest = c;	    }	}	/*  Allocate the no. of items of this class to use in the window  */	TargetClassFreq[Smallest] = Min(ClassFreq[Smallest], Round(Size/ClassesLeft));	ClassFreq[Smallest] = 0;	Size -= TargetClassFreq[Smallest];	ClassesLeft--;    }    cfree(ClassFreq);}/*************************************************************************//*									 *//*  Form initial window, attempting to obtain the target class profile	 *//*  in TargetClassFreq.  This is done by placing the targeted number     *//*  of items of each class at the beginning of the set of data items.	 *//*									 *//*************************************************************************/    FormInitialWindow()/*  -------------------  */{    ItemNo i, Start=0, More;    ClassNo c;    void Swap();    Shuffle();    ForEach(c, 0, MaxClass)    {	More = TargetClassFreq[c];	for ( i = Start ; More ; i++ )	{	    if ( Class(Item[i]) == c )	    {		Swap(Start, i);		Start++;		More--;	    }	}    }}/*************************************************************************//*									 *//*		Shuffle the data items randomly				 *//*									 *//*************************************************************************/    Shuffle()/*  -------  */{    ItemNo This, Alt, Left;    Description Hold;    This = 0;    for( Left = MaxItem+1 ; Left ; )    {        Alt = This + (Left--) * Random;        Hold = Item[This];        Item[This++] = Item[Alt];        Item[Alt] = Hold;    }}/*************************************************************************//*									 *//*  Grow a tree iteratively with initial window size Window and		 *//*  initial window increment IncExceptions.				 *//*									 *//*  Construct a classifier tree using the data items in the		 *//*  window, then test for the successful classification of other	 *//*  data items by this tree.  If there are misclassified items,		 *//*  put them immediately after the items in the window, increase	 *//*  the size of the window and build another classifier tree, and	 *//*  so on until we have a tree which successfully classifies all	 *//*  of the test items or no improvement is apparent.			 *//*									 *//*  On completion, return the tree which produced the least errors.	 *//*									 *//*************************************************************************/Tree Iterate(Window, IncExceptions)/*   -------  */    ItemNo Window, IncExceptions;{    Tree Classifier, BestClassifier=Nil, FormTree();    ItemNo i, Errors, TotalErrors, BestTotalErrors=MaxItem+1,	   Exceptions, Additions;    ClassNo Assigned, Category();    short Cycle=0;    void Swap();    printf("Cycle   Tree    -----Cases----");    printf("    -----------------Errors-----------------\n");    printf("        size    window   other");    printf("    window  rate   other  rate   total  rate\n");    printf("-----   ----    ------  ------");    printf("    ------  ----  ------  ----  ------  ----\n");    do    {	/*  Build a classifier tree with the first Window items  */	InitialiseWeights();	AllKnown = true;	Classifier = FormTree(0, Window-1);	/*  Error analysis  */	Errors = Round(Classifier->Errors);	/*  Move all items that are incorrectly classified by the	    classifier tree to immediately after the items in the	    current window.  */	Exceptions = Window;	ForEach(i, Window, MaxItem)	{	    Assigned = Category(Item[i], Classifier);	    if ( Assigned != Class(Item[i]) )	    {		Swap(Exceptions, i);		Exceptions++;	    }	}        Exceptions -= Window;	TotalErrors = Errors + Exceptions;	/*  Print error analysis  */	printf("%3d  %7d  %8d  %6d  %8d%5.1f%%  %6d%5.1f%%  %6d%5.1f%%\n",	       ++Cycle, TreeSize(Classifier), Window, MaxItem-Window+1,	       Errors, 100*(float)Errors/Window,	       Exceptions, 100*Exceptions/(MaxItem-Window+1.001),	       TotalErrors, 100*TotalErrors/(MaxItem+1.0));	/*  Keep track of the most successful classifier tree so far  */	if ( ! BestClassifier || TotalErrors < BestTotalErrors )	{	    if ( BestClassifier ) ReleaseTree(BestClassifier);	    BestClassifier = Classifier;	    BestTotalErrors = TotalErrors;        }	else	{	    ReleaseTree(Classifier);	}	/*  Increment window size  */	Additions = Min(Exceptions, IncExceptions);	Window = Min(Window + Max(Additions, Exceptions / 2), MaxItem + 1);    }    while ( Exceptions );    return BestClassifier;}/*************************************************************************//*									 *//*	Print report of errors for each of the trials			 *//*									 *//*************************************************************************/    Evaluate(CMInfo, Saved)/*  --------  */    Boolean CMInfo;    short Saved;{    ClassNo RealClass, PrunedClass, Category();    short t;    ItemNo *ConfusionMat, i, RawErrors, PrunedErrors;    if ( CMInfo )    {	ConfusionMat = (ItemNo *) calloc((MaxClass+1)*(MaxClass+1), sizeof(ItemNo));    }    printf("\n");    if ( TRIALS > 1 )    {	printf("Trial\t Before Pruning           After Pruning\n");	printf("-----\t----------------   ---------------------------\n");    }    else    {	printf("\t Before Pruning           After Pruning\n");	printf("\t----------------   ---------------------------\n");    }    printf("\tSize      Errors   Size      Errors   Estimate\n\n");    ForEach(t, 0, TRIALS-1)    {	RawErrors = PrunedErrors = 0;	ForEach(i, 0, MaxItem)	{	    RealClass = Class(Item[i]);	    if ( Category(Item[i], Raw[t]) != RealClass ) RawErrors++;	    PrunedClass = Category(Item[i], Pruned[t]);	    if ( PrunedClass != RealClass ) PrunedErrors++;	    if ( CMInfo && t == Saved )	    {		ConfusionMat[RealClass*(MaxClass+1)+PrunedClass]++;	    }	}    	if ( TRIALS > 1 )	{	    printf("%4d", t);	}	printf("\t%4d  %3d(%4.1f%%)   %4d  %3d(%4.1f%%)    (%4.1f%%)%s\n",	       TreeSize(Raw[t]), RawErrors, 100.0*RawErrors / (MaxItem+1.0),	       TreeSize(Pruned[t]), PrunedErrors, 100.0*PrunedErrors / (MaxItem+1.0),	       100 * Pruned[t]->Errors / Pruned[t]->Items,	       ( t == Saved ? "   <<" : "" ));    }    if ( CMInfo )    {	PrintConfusionMatrix(ConfusionMat);	free(ConfusionMat);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产女主播视频一区二区| 亚洲免费高清视频在线| 久久精品日韩一区二区三区| 欧美男男青年gay1069videost | 成人午夜碰碰视频| 日本韩国精品在线| 精品少妇一区二区三区日产乱码| 久久久久久免费网| 亚洲一区免费观看| 激情综合网最新| 99视频超级精品| 欧美日韩国产在线观看| 中文字幕巨乱亚洲| 日韩av一区二区在线影视| 美女尤物国产一区| 99精品视频在线免费观看| 91精品久久久久久久99蜜桃| 欧美r级在线观看| 亚洲一区视频在线| 成人黄色软件下载| 欧美变态tickle挠乳网站| 亚洲丝袜美腿综合| 国产高清在线观看免费不卡| 欧美三级电影精品| 国产精品福利在线播放| 午夜国产不卡在线观看视频| 成人av免费在线| 精品国产伦一区二区三区观看方式| 亚洲三级视频在线观看| 国产福利一区二区三区视频| 欧美日韩一区二区三区四区| 亚洲视频中文字幕| 免费精品99久久国产综合精品| 91丨porny丨中文| 久久久久久久电影| 国内外成人在线视频| 91麻豆精品久久久久蜜臀 | 久久99精品国产91久久来源| 欧美色综合久久| 国产亚洲综合在线| 国产精品白丝jk白祙喷水网站| 欧美一区二区三区在线| 亚洲一区二区欧美激情| 国产伦精一区二区三区| 欧美激情一区二区三区| 国产白丝精品91爽爽久久| 久久精品一区四区| 久久精品国产99国产| 久久蜜桃av一区精品变态类天堂 | 99精品热视频| 久久午夜羞羞影院免费观看| 国产成人欧美日韩在线电影| 久久精子c满五个校花| 国内精品久久久久影院薰衣草| 欧美xxxx在线观看| 成人午夜激情影院| 中文字幕欧美国产| 93久久精品日日躁夜夜躁欧美| 国产精品美女久久久久久久| 国产成人精品网址| 中国av一区二区三区| 成人app网站| 亚洲免费在线观看视频| 欧美久久一二区| 久久99精品国产| 国产欧美精品区一区二区三区| 粉嫩13p一区二区三区| 国产精品成人一区二区三区夜夜夜| 国产一区二区三区蝌蚪| 国产精品福利一区二区| 在线看不卡av| 奇米精品一区二区三区在线观看一| 欧美综合一区二区三区| 日本欧美大码aⅴ在线播放| 久久久亚洲精品一区二区三区| 成人教育av在线| 亚洲一区二区中文在线| 欧美日韩你懂的| 国产一区二区三区四区五区美女| 中文字幕av资源一区| 在线观看日韩毛片| 激情综合五月婷婷| 日韩黄色一级片| 国产精品毛片a∨一区二区三区 | 亚洲精品videosex极品| 亚洲品质自拍视频| 日韩精品在线一区二区| 色综合久久久久综合| 韩日欧美一区二区三区| 欧美一级欧美三级在线观看| 欧美日韩免费在线视频| 粉嫩蜜臀av国产精品网站| 日韩电影在线一区| 一区二区三区四区在线免费观看| 日韩欧美的一区| 欧美日本在线一区| av中文字幕亚洲| 国产精品一级片在线观看| 欧美a级一区二区| 亚洲第一福利一区| 亚洲三级视频在线观看| 国产精品日韩精品欧美在线| 久久男人中文字幕资源站| 欧美国产精品一区二区三区| 欧美日韩中文国产| 欧洲另类一二三四区| 播五月开心婷婷综合| 国产mv日韩mv欧美| 国产精品一区二区无线| 狠狠色丁香久久婷婷综合_中 | 国产精品久久午夜| 精品国产sm最大网站| 日韩欧美黄色影院| 日韩欧美一区二区三区在线| 91麻豆精品91久久久久同性| 欧美日韩在线观看一区二区| 欧美私人免费视频| 欧美精品九九99久久| 欧美日韩亚州综合| 欧美久久免费观看| 日韩一级高清毛片| 日韩一区二区三| 欧美一区二区三区免费大片| 欧美一区二区三区视频在线| 日韩免费一区二区| 337p粉嫩大胆色噜噜噜噜亚洲| 久久噜噜亚洲综合| 日本一区二区视频在线| 亚洲天天做日日做天天谢日日欢| 1024国产精品| 亚洲精品少妇30p| 亚洲第一会所有码转帖| 热久久久久久久| 国产精品综合一区二区三区| 处破女av一区二区| 一本色道久久加勒比精品 | 亚洲成人av在线电影| 日本欧美一区二区| 国产成人在线网站| 欧美优质美女网站| 日韩欧美亚洲一区二区| 国产夜色精品一区二区av| 亚洲欧美日韩国产成人精品影院 | 国产成人在线影院| 91小视频在线免费看| 7777精品伊人久久久大香线蕉的 | 亚洲一区二区三区激情| 日本午夜一本久久久综合| 国产精品中文字幕日韩精品| 91欧美激情一区二区三区成人| 欧美三区在线视频| 久久免费电影网| 一片黄亚洲嫩模| 另类小说一区二区三区| 成人h版在线观看| 91.麻豆视频| 国产欧美日本一区二区三区| 亚洲天堂精品在线观看| 欧美日韩久久久一区| 精品奇米国产一区二区三区| 中文字幕制服丝袜成人av| 午夜精品影院在线观看| 国产成人8x视频一区二区| 欧美亚洲国产一区二区三区| 久久夜色精品国产噜噜av| 亚洲图片欧美色图| 国产盗摄一区二区三区| 欧美肥妇bbw| 亚洲精品中文字幕在线观看| 国产在线精品视频| 欧美日韩的一区二区| 欧美激情一区二区三区在线| 蜜桃视频一区二区| 在线观看亚洲一区| 国产精品乱人伦中文| 九色|91porny| 欧美一区二区三级| 亚洲一区二区三区自拍| 国产成人午夜电影网| 精品乱码亚洲一区二区不卡| 亚洲一区二区精品久久av| 91网页版在线| 亚洲国产精品ⅴa在线观看| 九九热在线视频观看这里只有精品| 欧美日韩一区视频| 一区二区三区在线观看视频| 成人在线视频首页| 国产午夜亚洲精品不卡| 狠狠色伊人亚洲综合成人| 欧美一区二区三区在| 日韩高清不卡一区二区| 欧美人妇做爰xxxⅹ性高电影| 亚洲免费资源在线播放| 99精品视频一区二区三区| 国产精品久久久久久久久动漫| 国产91综合一区在线观看| 久久综合色之久久综合| 国产综合久久久久久鬼色| 欧美精品一区二区三区蜜桃| 九色porny丨国产精品|