📄 extern.h
字号:
#ifndef _NEWSTAR_EXTERN_H_1999_12_23_11_24_34_OLDMOON_
#define _NEWSTAR_EXTERN_H_1999_12_23_11_24_34_OLDMOON_
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
//Patched by oldmoon,99-12-23 上午 11:25:00
/*************************************************************************/
/* */
/* Global data for C4.5 */
/* -------------------- */
/* */
/*************************************************************************/
extern int MaxAtt, /* max att number */
MaxClass, /* max class number */
MaxDiscrVal; /* max discrete values for any att */
extern ItemNo MaxItem; /* max data item number */
extern Description *Item; /* data items */
extern DiscrValue *MaxAttVal; /* number of values for each att */
extern char *SpecialStatus; /* special att treatment */
extern String *ClassName, /* class names */
*AttName, /* att names */
**AttValName, /* att value names */
FileName; /* family name of files */
extern Boolean AllKnown; /* true if there have been no splits
on atts with missing values above
the current position in the tree */
/*************************************************************************/
/* */
/* Global parameters for C4.5 */
/* -------------------------- */
/* */
/*************************************************************************/
extern int VERBOSITY, /* verbosity level (0 = none) */
TRIALS; /* number of trees to be grown */
extern Boolean GAINRATIO, /* true=gain ratio, false=gain */
SUBSET, /* true if subset tests allowed */
BATCH, /* true if windowing turned off */
UNSEENS, /* true if to evaluate on test data */
PROBTHRESH; /* true if to use soft thresholds */
extern ItemNo MINOBJS, /* minimum items each side of a cut */
WINDOW, /* initial window size */
INCREMENT; /* max window increment each iteration */
extern double CF; /* confidence limit for tree pruning */
/************************************************************/
/* Function externs */
/************************************************************/
void InitialiseTreeData();
void InitialiseWeights();
Tree FormTree(ItemNo Fp, ItemNo Lp);
void PrintTree(Tree T);
void SaveTree(Tree T, String Extension);
Tree CopyTree(Tree T);
Boolean Prune(Tree T);
void FormTarget(ItemNo Size);
void FormInitialWindow();
Tree Iterate(ItemNo Window, ItemNo IncExceptions);
void Shuffle();
void Swap(ItemNo a,ItemNo b);
ClassNo Category(Description CaseDesc, Tree DecisionTree);
int TreeSize(Tree Node);
void ReleaseTree(Tree Node);
void PrintConfusionMatrix(ItemNo * ConfusionMat);
ItemCount CountItems(ItemNo Fp,ItemNo Lp);
Tree Leaf(ItemCount *ClassFreq, ClassNo NodeClass, ItemCount Cases, ItemCount Errors);
void EvalSubset(Attribute Att, ItemNo Fp, ItemNo Lp, ItemCount Items);
void EvalDiscreteAtt(Attribute Att, ItemNo Fp, ItemNo Lp, ItemCount Items);
void EvalContinuousAtt(Attribute Att, ItemNo Fp, ItemNo Lp);
double Worth(double ThisInfo, double ThisGain, double MinGain);
void SubsetTest(Tree Node, Attribute Att);
void DiscreteTest(Tree Node, Attribute Att);
void ContinTest(Tree Node, Attribute Att);
ItemNo Group(DiscrValue V, ItemNo Fp, ItemNo Lp, Tree TestNode);
void PrintHeader(char * Title);
int getopt(int Argc, char **Argv, char *Str);
double EstimateErrors(Tree T, ItemNo Fp, ItemNo Lp, int Sh, Boolean UpdateTree);
void GetNames();
void GetData(String Extension);
void OneTree();
void SoftenThresh(Tree T);
void Evaluate(Boolean CMInfo, int Saved);
void Classify(Description CaseDesc, Tree T, double Weight);
void ResetFreq(DiscrValue MaxVal);
void Quicksort(ItemNo Fp, ItemNo Lp, Attribute Att, void (*Exchange)(int,int));
double TotalInfo(ItemCount V[], DiscrValue MinVal, DiscrValue MaxVal);
double ComputeGain(double BaseInfo, double UnknFrac, DiscrValue MaxVal, ItemCount TotalItems);
void PrintDistribution(Attribute Att, DiscrValue MaxVal,Boolean ShowNames);
void Sprout(Tree Node, DiscrValue Branches);
double GreatestValueBelow(Attribute Att, double t);
void ComputeFrequencies(Attribute Att,ItemNo Fp,ItemNo Lp);
double DiscrKnownBaseInfo(ItemCount KnownItems,DiscrValue MaxVal);
void Error(int n, String s1, String s2);
Description GetDescription(FILE *Df);
Boolean ReadName(FILE *f, String s);
int Which(String Val, String List[], int First, int Last);
String CopyString(String x);
void CheckPossibleValues(Tree T);
double AddErrs(ItemCount N, ItemCount e);
void Indent(int Sh, char *Mark);
void ScanTree(Tree T, ItemNo Fp, ItemNo Lp);
void Combine(DiscrValue x, DiscrValue y, DiscrValue Last);
void Uncombine(DiscrValue x, DiscrValue y);
void PrintSubset(Attribute Att, Set Ss);
void Show(Tree T,int Sh);
int MaxLine(Tree St);
void ShowBranch(int Sh, Tree T, DiscrValue v);
void OutTree(Tree T);
void StreamOut(String s, int n);
void StreamIn(String s,int n);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -