• 大小: 2.03MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-25
  • 语言: Java
  • 标签:

资源简介

这是一款基于knn算法的分类器,能够进行文本分类,网页分类,是基于java语言编写的

资源截图

代码片段和文件信息

// DisplayPercent.cpp : implementation file
//

#include “stdafx.h“
#include “knnclassfier.h“
#include “DisplayPercent.h“

#define TESTNUM 80

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDisplayPercent dialog


CDisplayPercent::CDisplayPercent(CWnd* pParent /*=NULL*/)
: CDialog(CDisplayPercent::IDD pParent)
{
//{{AFX_DATA_INIT(CDisplayPercent)
//}}AFX_DATA_INIT
}


void CDisplayPercent::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDisplayPercent)
DDX_Control(pDX ID_ENT m_nEnt);
DDX_Control(pDX ID_EDU m_nEdu);
DDX_Control(pDX ID_FASH m_nFash);
DDX_Control(pDX ID_COM m_nCom);
DDX_Control(pDX IDC_PROGRESS4 m_nComPro);
DDX_Control(pDX IDC_PROGRESS3 m_nFashPro);
DDX_Control(pDX IDC_PROGRESS2 m_nEntPro);
DDX_Control(pDX IDC_PROGRESS1 m_nEduPro);
//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDisplayPercent CDialog)
//{{AFX_MSG_MAP(CDisplayPercent)
ON_WM_CTLCOLOR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDisplayPercent message handlers

void CDisplayPercent::OnComPer(int OriType[]int ClassedType[]) //计算分类准确率的函数
{
    
//查全率= 事实属于此类且被分类正确的文档数/属于此类的总文档数;


float m_Per;
float Sum = 0.0;

for (int i = 0;i < 80; i++) 
{
if (OriType[i] == ClassedType[i])    //分类结果与预期相同时,统计数目加一   
{
Sum++;
if(OriType[i] != OriType[i+1])              //当第一类的测试网页统计完毕 
{
m_Per = Sum / 20; 

m_fCompletePercent.push_back(m_Per);     //存储查全率

Sum = 0.0;
}

}

}

/*CString stri;
stri.Format(“%f%f%f%f“m_fCompletePercent.at(0)m_fCompletePercent.at(1)m_fCompletePercent.at(2)m_fCompletePercent.at(3));
    MessageBox(stri);*/

}

BOOL CDisplayPercent::OnInitDialog() 
{
CDialog::OnInitDialog();

// TODO: Add extra initialization here


CProgressCtrl * pProg;
pProg = (CProgressCtrl *)GetDlgItem(IDC_PROGRESS1);    
pProg->SendMessage(PBM_SETBKCOLOR 0 RGB(255255255));//背景色   
    pProg->SendMessage(PBM_SETBARCOLOR 0 RGB(02050));//前景色
pProg = (CProgressCtrl *)GetDlgItem(IDC_PROGRESS2);    
pProg->SendMessage(PBM_SETBKCOLOR 0 RGB(255255255));//背景色   
    pProg->SendMessage(PBM_SETBARCOLOR 0 RGB(02050));//前景色
pProg = (CProgressCtrl *)GetDlgItem(IDC_PROGRESS3);    
pProg->SendMessage(PBM_SETBKCOLOR 0 RGB(255255255));//背景色   
    pProg->SendMessage(PBM_SETBARCOLOR 0 RGB(02050));//前景色
pProg = (CProgressCtrl *)GetDlgItem(IDC_PROGRESS4);    
pProg->SendMessage(PBM_SETBKCOLOR 0 RGB(255255255));//背景色   
    pProg->SendMessage(PBM_SETBARCOLOR 0 RGB(02050));//前景色

m_nEduPro.SetRange(0100);
m_nEduPro.SetPos(0);
m_nEntPro.SetRange(0100);
m_nEntPro.SetPos(0);
m_nFashPro.SetRange(0100);
m_nFashPro.SetPos(0);
m_nComPr

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     目录          0  2007-06-23 20:59  KnnClassfier

     文件       6853  2007-06-16 12:51  KnnClassfier\DisplayPercent.cpp

     文件       1870  2007-06-17 15:20  KnnClassfier\DisplayPercent.h

     文件       8532  2007-06-16 12:51  KnnClassfier\FullEvaluateDisplay.cpp

     文件       1961  2007-06-17 15:20  KnnClassfier\FullEvaluateDisplay.h

     文件      45676  2007-06-18 08:24  KnnClassfier\KnnClassfier.aps

     文件       7104  2007-06-18 17:34  KnnClassfier\KnnClassfier.clw

     文件       2173  2007-06-01 18:07  KnnClassfier\KnnClassfier.cpp

     文件       4996  2007-06-16 12:52  KnnClassfier\KnnClassfier.dsp

     文件        549  2007-05-12 10:18  KnnClassfier\KnnClassfier.dsw

     文件       1390  2007-06-01 18:12  KnnClassfier\KnnClassfier.h

     文件     353280  2007-06-18 17:34  KnnClassfier\KnnClassfier.ncb

     文件      59904  2007-06-18 17:34  KnnClassfier\KnnClassfier.opt

     文件       2843  2007-06-18 08:24  KnnClassfier\KnnClassfier.plg

     文件      13144  2007-06-18 08:24  KnnClassfier\KnnClassfier.rc

     文件      37727  2007-06-17 15:47  KnnClassfier\KnnClassfierDlg.cpp

     文件       4033  2007-06-17 15:20  KnnClassfier\KnnClassfierDlg.h

     文件       3479  2007-06-16 12:51  KnnClassfier\MacroFDisplay.cpp

     文件       1617  2007-06-17 15:20  KnnClassfier\MacroFDisplay.h

     文件        931  2007-05-16 18:01  KnnClassfier\PageInfo.cpp

     文件        847  2007-05-16 16:27  KnnClassfier\PageInfo.h

     文件       3687  2007-05-12 10:18  KnnClassfier\ReadMe.txt

     文件       4132  2007-06-18 08:24  KnnClassfier\resource.h

     文件        214  2007-05-12 10:18  KnnClassfier\StdAfx.cpp

     文件       1054  2007-05-12 10:18  KnnClassfier\StdAfx.h

     文件       7381  2007-05-27 10:46  KnnClassfier\TextProgressCtrl.cpp

     文件       2310  2007-05-27 17:17  KnnClassfier\TextProgressCtrl.h

     目录          0  2007-06-23 20:59  KnnClassfier\文件

     文件      16427  2007-05-12 21:44  KnnClassfier\文件\CharacterWord.txt

     文件         66  2007-05-26 20:21  KnnClassfier\文件\content2.txt

............此处省略91个文件信息

评论

共有 条评论

相关资源