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

📄 nbc.h

📁 C语言的朴素贝叶斯分类器代码
💻 H
字号:
#ifndef NBC_TABLE_H#define NBC_TABLE_H#include "dataTab.h"#include "rawDataTable.h"#include "classInfo.h"#include "attributeInfo.h"// Naive Bayesian Classifier//   the class NBC_Table consists of the//   SupervisedDataTable, AttributeInfoTable and//   ClassInfoTable. and also a ClassSummary.class NBC_Table {	SupervisedDataTable *trainData;	AttributeInfoTable **attrTable;	ClassInfoTable     *classTable;	int error;	ClassSummary       *cSTable;public:	// constructor	NBC_Table(Source &src);	// classify the raw data table, and write the	// classfication results into the raw data table.	void NBC_classify(RawDataTable &rDTbl);	// return the ojbect pointer of the training data table	SupervisedDataTable *getSupervisedDataTable() { return trainData; }	// print the training data error rate	void reportTrainingDataErrorRate();	// print the probability table	void printProbTable();	void showProbSize();	// destructor	~NBC_Table();private:	Description classify(int r, int c, RawDataTable &rDTbl);	float NBC_calculateProb(int nc, Description *inst, int n_Col);	int maxIndex(float *p, int n);};#endif

⌨️ 快捷键说明

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