Class ESMiner
- java.lang.Object
-
- edu.gsu.cs.dmlab.solgrind.algo.stesminers.ESMiner
-
- Direct Known Subclasses:
ESGrowthMiner
,SequenceConnectMiner
,TopRKESMiner
public abstract class ESMiner extends Object
- Author:
- Ahmet Kucuk, Data Mining Lab, Georgia State University
-
-
Field Summary
Fields Modifier and Type Field Description protected SequenceGraph
esGraph
protected Map<EventType,Integer>
eventCounts
protected int
MAX_SEQUENCE_LENGTH
protected org.jgrapht.alg.DirectedNeighborIndex<InstanceVertex,RelationEdge>
neighbors
protected Map<EventSequence,Double>
resultEventSequenceDoubleMap
-
Constructor Summary
Constructors Constructor Description ESMiner(SequenceGraph esGraph)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected double
calculatePI(EventSequence eSq, ArrayList<HashSet<String>> iSqIdList)
This method calculates the prevalence index (PI) of a given EventSequence object using the @eventCounts (from this class) and a list (of set) of instance sequence identifiers (passed as parameter using iSqIdList).protected ArrayList<HashSet<String>>
createIdList(Set<InstanceSequence> instanceSequences, EventSequence eventSequence)
Given an event sequence and its instance sequences, this method creates a complex identifier list of unique identifier sets.protected Set<InstanceSequence>
createInstanceSequencesFromVertices(Set<InstanceVertex> instanceVertices)
This method converts a set of instance vertices (stored in instanceVertices) to a set of length-1 instance sequences.Map<EventSequence,Set<InstanceSequence>>
createSuccessorMap(EventSequence parentEventSequence, Set<InstanceSequence> parentInstanceSequences)
Using the event sequence graph, create a complex successors map that stores EventSequence->Setmappings, which are identified using the parentEventSequence, and the instance sequences of parentEventSequence (that is parentInstanceSequences). protected Set<InstanceSequence>
findChildrenMap(Set<InstanceSequence> instanceSequences, EventType eChild)
protected HashSet<InstanceVertex>
findVerticesOfType(EventType eventType, boolean isNonLeaf)
Find vertices (instances) of a particular event type in the event sequence graph Also available is the non-leaf flag, where it is set to true, it finds non-leaf vertices of type eventTypeabstract Map<EventSequence,Double>
getResultInMap()
abstract Set<EventSequence>
getResultSet()
protected abstract void
mineGraph()
protected HashMap<InstanceSequence,Double>
searchInstanceSequences(EventSequence esq)
-
-
-
Field Detail
-
neighbors
protected final org.jgrapht.alg.DirectedNeighborIndex<InstanceVertex,RelationEdge> neighbors
-
esGraph
protected final SequenceGraph esGraph
-
resultEventSequenceDoubleMap
protected Map<EventSequence,Double> resultEventSequenceDoubleMap
-
MAX_SEQUENCE_LENGTH
protected final int MAX_SEQUENCE_LENGTH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ESMiner
public ESMiner(SequenceGraph esGraph)
-
-
Method Detail
-
mineGraph
protected abstract void mineGraph()
-
getResultSet
public abstract Set<EventSequence> getResultSet()
-
getResultInMap
public abstract Map<EventSequence,Double> getResultInMap()
-
findVerticesOfType
protected HashSet<InstanceVertex> findVerticesOfType(EventType eventType, boolean isNonLeaf)
Find vertices (instances) of a particular event type in the event sequence graph Also available is the non-leaf flag, where it is set to true, it finds non-leaf vertices of type eventType- Parameters:
eventType
- - event type whose instances are to be foundisNonLeaf
- - non-leaf flag, when true instances are non-leaf, when false all instances are returned- Returns:
- - a set of instance vertices of type eventType
-
calculatePI
protected double calculatePI(EventSequence eSq, ArrayList<HashSet<String>> iSqIdList)
This method calculates the prevalence index (PI) of a given EventSequence object using the @eventCounts (from this class) and a list (of set) of instance sequence identifiers (passed as parameter using iSqIdList). iSqIdList has the list of sets of unique instance identifiers per each EventType in the given EventSequence object (eSq).- Parameters:
eSq
- - given event sequence object (to calculate the pi)iSqIdList
- - list of set of unique id's, indexed on the location of event type in eSq- Returns:
- - prevalence index value (min of all participation ratios) of eSq
-
createIdList
protected ArrayList<HashSet<String>> createIdList(Set<InstanceSequence> instanceSequences, EventSequence eventSequence)
Given an event sequence and its instance sequences, this method creates a complex identifier list of unique identifier sets. The participating instances of each event type in the event sequence is returned as a set of strings (that stores unique ids for each event type)- Parameters:
instanceSequences
- - set of instance sequences of type event sequenceeventSequence
- - the event sequence whose instances are to be inspected- Returns:
- - arraylist of set of unique identifiers (of participating instances) in order
-
createSuccessorMap
public Map<EventSequence,Set<InstanceSequence>> createSuccessorMap(EventSequence parentEventSequence, Set<InstanceSequence> parentInstanceSequences)
Using the event sequence graph, create a complex successors map that stores EventSequence->Setmappings, which are identified using the parentEventSequence, and the instance sequences of parentEventSequence (that is parentInstanceSequences). In other words, from the instance sequences of a particular event sequence, this method finds the instance sequences of child event sequences (found by extending the parent event sequence) - Parameters:
parentEventSequence
- - the event sequence to be extendedparentInstanceSequences
- - the instance sequences of the given parent event sequence- Returns:
- the map of child event sequences to its instance sequences
-
createInstanceSequencesFromVertices
protected Set<InstanceSequence> createInstanceSequencesFromVertices(Set<InstanceVertex> instanceVertices)
This method converts a set of instance vertices (stored in instanceVertices) to a set of length-1 instance sequences. For each instance vertex, a new instance sequence of length-1 is created.- Parameters:
instanceVertices
- - to be converted instance sequences- Returns:
- a set of instance sequences (of length-1)
-
searchInstanceSequences
protected HashMap<InstanceSequence,Double> searchInstanceSequences(EventSequence esq)
-
findChildrenMap
protected Set<InstanceSequence> findChildrenMap(Set<InstanceSequence> instanceSequences, EventType eChild)
-
-