-
Notifications
You must be signed in to change notification settings - Fork 0
/
algorithm.hpp
46 lines (36 loc) · 1.15 KB
/
algorithm.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Author: Kristi Daigh
// Project: MLEM2 Rule Induction
// Date: 11/20/2019
/** Header file for algorithm class.
@file algorithm.hpp
This class handles the execution
of the MLEM2 algorithm. */
#ifndef ALGORITHM_H
#define ALGORITHM_H
#include "avNumeric.hpp"
#include "avSymbolic.hpp"
#include "dataset.hpp"
#include "localCover.hpp"
#include "utils.hpp"
#include <set>
#include <vector>
#define DEBUG false
class Algorithm {
public:
Algorithm(std::size_t numAttributes);
/* Generate attribute-value blocks for dataset.
@post m_avBlocks is initialized and populated. */
void generateAVBlocks(Dataset * data);
/* Generate concept blocks for dataset. */
std::vector<Concept *> generateConcepts(Dataset * data);
/* Creates string with all rules in (a, v) -> (d, v) format. */
void generateRuleset(ostream & file, Dataset * data);
/* Generate ruleset using MLEM2. */
LocalCover induceRules(Concept * concept);
/* Finds the position of the best attribute-value pair. */
int getOptimalCondition(map<int, set<int>> T_G);
private:
std::size_t m_numAttributes;
std::vector<AV *> m_avBlocks;
};
#endif