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

📄 assrule.h

📁 用data miming技术进行false prediction
💻 H
字号:
#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -