📄 confmat.cpp
字号:
/*************************************************************************/
/* */
/* Routine for printing confusion matrices */
/* --------------------------------------- */
/* */
/*************************************************************************/
#include "defns.h"
#include "c45types.h"
#include "extern.h"
extern FILE *fpScreen;
void PrintConfusionMatrix(ItemNo * ConfusionMat)
/* -------------------- */
{
int Row, Col;
/* Print the heading, then each row */
fprintf(fpScreen,"\n\n\t");
printf("\n\n\t");
ForEach(Col, 0, MaxClass)
{
fprintf(fpScreen," (%c)", 'a' + Col);
printf(" (%c)", 'a' + Col);
}
fprintf(fpScreen,"\t<-classified as\n\t");
printf("\t<-classified as\n\t");
ForEach(Col, 0, MaxClass)
{
fprintf(fpScreen," ----");
printf(" ----");
}
fprintf(fpScreen,"\n");
printf("\n");
ForEach(Row, 0, MaxClass)
{
fprintf(fpScreen,"\t");
printf("\t");
ForEach(Col, 0, MaxClass)
{
if ( ConfusionMat[Row*(MaxClass+1) + Col] )
{
fprintf(fpScreen,"%5d", ConfusionMat[Row*(MaxClass+1) + Col]);
printf("%5d", ConfusionMat[Row*(MaxClass+1) + Col]);
}
else
{
fprintf(fpScreen," ");
printf(" ");
}
}
fprintf(fpScreen,"\t(%c): class %s\n", 'a' + Row, ClassName[Row]);
printf("\t(%c): class %s\n", 'a' + Row, ClassName[Row]);
}
fprintf(fpScreen,"\n");
printf("\n");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -