id3.h

来自「商业智能用 决策树 Id3算法 C语言」· C头文件 代码 · 共 28 行

H
28
字号
typedef unsigned int  UINT;
typedef unsigned long ULONG;
typedef          char CHAR;
typedef unsigned char BOOL;
typedef double        REAL;

typedef struct node {
   UINT idx;			/* ID code for attribute */
   REAL threshold;		/* Numerical threshold for attribute test */
   struct node *on;		/* Address of 'on' node */
   struct node *off;		/* Address of 'off' node */
   struct node *parent; 	/* Addess of parent node */
} NODE;

typedef struct ne_struct {
    REAL ne;
    UINT status;
} NEGENTROPY;

typedef struct matrix {
   UINT width;
   UINT height;
   REAL **data;
} MATRIX;

enum	UINT { INACTIVE, OFF, ON };
#define LN_2 0.693147180559945309417
#define entropy(x) (x > 0 ? x * log(x) / LN_2 : 0.0) /* Decision */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?