⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 naivebayes.h

📁 【机器学习】文本分类源代码 【机器学习】文本分类源代码
💻 H
字号:
#ifndef __NAIVEBAYES_H_
#define __NAIVEBAYES_H_

#pragma warning( disable : 4786 )

#include "doclist.h"
#include <string>
#include <map>


using namespace std;

class CNaiveBayes
{
private:
	int				m_CatCnt;
	long			m_DocCnt;
	set<int>		setWId,setCat;
	map<int,double> mapCatId_CatProb;
	map<int,long>	mapCatId_WordCnt;
	map<int,long>	mapCatId_DocCnt;
	map<int,map<int,double > > mapCatId_WIdProb;
public:
	CNaiveBayes();
	~CNaiveBayes();
	void Train( CDocList& );
	int ClassifyDocs( DOC& test_doc );
	void ClassifyDocs( string sVectorFile, string sResultFile );
};

#endif

⌨️ 快捷键说明

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