infomeasure.h
来自「vc的源代码程序的基于最小特征向量的元素的集合方法的程序源代码」· C头文件 代码 · 共 38 行
H
38 行
#ifndef InfoMeasure_H#define InfoMeasure_H// use shannon's formula#include <math.h> float plogp(float P); // *CntV: is a Class Counter Vector. CntV[i] stores the number // of Class i's // Cnt: is the sum(CntV[0..M]), where M is the total // number of classes (ie. the numerically maximal class label // // Return value: // It returns the entropy value // Sum(plogp((float)CntV[k]/Cnt)), where k from 0..M, M // is the total number of classes float entropy (int MaxClass, int *CntV, int Cnt); // *leftCntV and *rightCntV: are 2 Class Counter Vector. // ith component will store the number of Class i's. // // leftCnt and rightCnt: are the sum of the components // respectively. // // total: = leftCnt + rightCnt // // Return value: // It returns the EXPECTED entropy value float infoMeasure(int MaxClass, int *leftCntV, int *rightCntV, int leftCnt, int rightCnt, int total);#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?