📄 infomeasure.h
字号:
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -