assrule.h
来自「用data miming技术进行false prediction」· C头文件 代码 · 共 65 行
H
65 行
#ifndef ASSRULE_H
#define ASSRULE_H
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <sstream>
#include "boost/algorithm/string.hpp"
#include <boost/tokenizer.hpp>
#include "boost/functional/hash.hpp"
#include "boost/functional/hash/map.hpp"
#include "AppException.h"
#include "Item.h"
#include "ItemHeaderTable.h"
#include "Node.h"
#include "FrequentItemset.h"
#include "Rule.h"
#include "Config.h"
#include "Event.h"
using namespace std;
using namespace boost;
typedef map<const size_t, FrequentItemset* , ltstr> fiHashMap;
class AssRule {
private:
ItemHeaderTable* itemHeaderTable;
Node* rootNode;
const char* dataFileName;
const char* testFileName;
fiHashMap* fiMap;
hash<string> string_hash;
vector<Rule*>* ruleVec;
void processFirstScan() throw (AppException);
void processSecondScan() throw (AppException);
void extractFrequentItemsets();
void genSubsets(string str, vector<string>* subsetVec);
void extractAssociationRules();
string getRule(string lString, string sString);
void checkPrediction(string inputStr);
void testAssociationRules() throw (AppException);
void computeStatistics();
int tp, fp, totRec, sinRec;
int testStartRec, testEndRec;
public:
AssRule(const char* dataFileName, int testStartRec, int testEndRec);
AssRule(const char* dataFileName, const char* testFileName, int testStartRec, int testEndRec);
~AssRule();
void runEngine() throw (AppException);
void learnRules() throw (AppException);
bool predictFailure(vector<Event*>* eventList) const;
string getPredictionResult(string inputStr);
};
#endif /* ASSRULE_H */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?