1 #ifndef HIERARCHYTREE_H 2 #define HIERARCHYTREE_H 4 #include "IncrementalEventLearning.h" 7 #define MINIMAL_DOUBLE -10e10 8 #define MAXIMAL_DOUBLE 10e10 9 #define EPSILON 0.0000001 10 #define ALMOST_ONE 0.99 11 #define DOUBLEOFSQRTPI 3.544907701811 15 enum categories { NEW_NODE,
24 std::map<attribute_id, SpContextualisedNumericalData > *numericalData;
25 std::map<attribute_id, SpContextualisedSymbolicData > *symbolicData;
28 void setInstance(std::map<attribute_id, SpContextualisedNumericalData > *i_numericalData,
29 std::map<attribute_id, SpContextualisedSymbolicData > *i_symbolicData);
33 typedef QSharedPointer<Instance> SpInstance;
37 static SpLearningAttributes availableAttributes;
38 static double minConditionalP;
41 std::map<long int, SpLearningStateConcept> registeredStates;
42 std::map<long int, SpLearningEventConcept> registeredEvents;
45 SpInstance currentInstance;
46 SpLearningContextualisedObject currentObject;
47 SpLearningContext currentContext;
48 std::map<int, SpLearningStateConcept> currentStatesForInstance;
50 double *k_components, k_parent;
52 int deepest_for_instance;
53 long int free_state_id;
54 long int free_event_id;
56 bool insertionDone, terminalDone, splitDone, mergeDone;
57 double diffSplit, diffNew, diffBest, diffMerge;
62 bool getDeepestSiblingStates(
double P, std::map<long int, SpLearningStateConcept> &states,
63 attribute_id _x, attribute_id _y);
65 std::map<long int, SpLearningStateConcept> &states,
66 attribute_id _x, attribute_id _y);
69 bool getMostLikelySiblingStates(
double P, std::map<long int, SpLearningStateConcept> &states);
71 std::map<long int, SpLearningStateConcept> &states);
72 double categoryUtility(
bool with_parent);
73 double categoryUtilityState(SpLearningStateConcept state,
int totalN,
double &totalP);
74 double categoryUtilityState(SpLearningStateConcept state);
75 bool kinshipRelation(SpLearningStateConcept state1, SpLearningStateConcept state2);
77 void setDepth(
int level);
80 int execute(SpLearningContext, SpLearningContextualisedObject,
double);
89 void copyEvents(SpLearningStateConcept original, SpLearningStateConcept toCopy);
95 SpLearningStateConcept);
99 int determineBest(
double,
double,
double,
double);
105 void computeKParent();
135 SpLearningStateConcept copyNode(SpLearningStateConcept);
137 SpLearningStateConcept copyInstance(SpInstance);
143 void incorporateNumericalValue(SpNumericalAttributeValuePair nodePair, SpContextualisedNumericalData instancePair,
double acuity);
145 void incorporateSymbolicValue(SpSymbolicAttributeValuePair nodePair, SpContextualisedSymbolicData instancePair);
147 double incrementalMean(
double,
double,
double,
double);
149 double incrementalSigma(
double,
double,
double,
double,
double,
double);
154 bool operator()(SpLearningStateConcept concept1, SpLearningStateConcept concept2);
158 bool operator()(SpLearningStateConcept concept1, SpLearningStateConcept concept2);
Definition: HierarchyTree.h:35
Definition: HierarchyTree.h:153
Definition: HierarchyTree.h:157
Definition: HierarchyTree.h:22
Definition: HierarchyTree.cpp:12