opyenxes.classification package

Submodules

opyenxes.classification.XEventAndClassifier module

class opyenxes.classification.XEventAndClassifier.XEventAndClassifier(comparators)[source]

Bases: opyenxes.classification.XEventAttributeClassifier.XEventAttributeClassifier

Composite event classifier, which can hold any number of lower-level classifiers, concatenated with boolean AND logic. This classifier will consider two events as equal, if all of its lower-level classifiers consider them as equal.

Parameters:comparators (list[XEventAttributeClassifier]) – Any number of lower-level classifiers, which are evaluated with boolean AND logic. If multiple lower-level classifiers use the same keys, this key is used only once in this classifier.

opyenxes.classification.XEventAttributeClassifier module

class opyenxes.classification.XEventAttributeClassifier.XEventAttributeClassifier(name, keys)[source]

Bases: object

Event classifier which considers two events as equal, if, for a set of given (configurable) attributes, they have the same values.

Parameters:
  • name (str) – Name of the classifier.
  • keys (list[str]) – List with the keys of the attributes used for event comparison.
compare_to(obj)[source]

Helper method to compares this object with the specified object for order.

Parameters:obj (XAttributeDiscrete) – the Object to be compared.
Returns:A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Return type:int
get_class_identity(event)[source]

Retrieves the unique class identity string of a given event.

Parameters:event (XEvent) – The given event to transform in the identity string.
Returns:The string that represent that event with this classifier.
Return type:str
get_defining_attribute_keys()[source]

Retrieves the set of attribute keys which are used in this event classifier (May be used for the construction of events that are not part of an existing event class).

Returns:An array of attribute keys, which are used for defining this classifier.
Return type:list[str]
name()[source]

Returns the name of this comparator

Returns:The name of this comparator.
Return type:str
same_event_class(event_a, event_b)[source]

Checks whether two event instances correspond to the same event class, i.e. are equal in that sense.

Parameters:
  • event_a (XEvent) – The first event to check.
  • event_b (XEvent) – The second event to check with the first.
Returns:

True if two event have the same event class, False otherwise.

Return type:

bool

set_name(name)[source]

Assigns a custom name to this classifier

Parameters:name – Name to be assigned to this classifier.
Return type:str

opyenxes.classification.XEventClass module

class opyenxes.classification.XEventClass.XEventClass(identity, index)[source]

Bases: object

Implements an event class. An event class is an identity for events, making them comparable. If two events are part of the same class, they are considered to be equal, i.e. to be referring to the same higher-level concept.

Parameters:
  • identity (str) – Unique identification string of the class, i.e. its name.
  • index (int) – Unique index of class.
compare_to(obj)[source]

Helper method to compares this object with the specified object for order.

Parameters:obj (XAttributeDiscrete) – The Object to be compared.
Returns:A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Return type:int
get_id()[source]
Retrieves the name, i.e. unique identification string, of this event
class.
Returns:The name of this class, as a unique string.
Return type:str
get_index()[source]

Returns the index of this event class.

Returns:Unique index.
Return type:int
increment_size()[source]

Increments the size of this class by one, i.e. adds another event to the number of represented instances.

set_size(size)[source]

Sets the size of this event class, i.e. the number of represented instances.

Parameters:size (int) – Number of events in this class.
size()[source]
Retrieves the size, i.e. the number of events represented by this
event class.
Returns:Size of this class.
Return type:int

opyenxes.classification.XEventClasses module

class opyenxes.classification.XEventClasses.XEventClasses(classifier)[source]

Bases: object

A set of event classes. For any log, this class can be used to impose a classification of events. Two events which belong to the same event class can be considered equal, i.e. to refer to the same higher-level concept they represent (e.g., an activity). Event classes are imposed on a log by a specific classifier. This class can be configured with such a classifier, which is then used to derive the actual event classes from a log, by determining the identity of the contained events.

Parameters:classifier (XEventAttributeClassifier) – The classifier used for creating the set of event classes.
static derive_event_classes(classifier, log)[source]

Creates a new set of event classes, factory method.

Parameters:
  • classifier (XEventAttributeClassifier) – The classifier to be used for event comparison.
  • log (XLog) – The log, on which event classes should be imposed.
Returns:

A set of event classes, as an instance of this class.

Return type:

XEventClasses

get_by_identity(identity)[source]

Returns a given event class by its identity, i.e. its unique identifier string.

Parameters:identity (str) – Identifier string of the requested event class.
Returns:The requested event class. If no matching event class is found, this method may return null.
Return type:XEventClass
get_by_index(index)[source]

Returns a given event class by its unique index.

Parameters:index (int) – Unique index of the requested event class.
Returns:The requested event class. If no matching event class is found, this method may return null.
Return type:XEventClass
get_class_of(event)[source]

For any given event, returns the corresponding event class as determined by this set.

Parameters:event (XEvent) – The event of which the event class should be determined.
Returns:The event class of this event, as found in this set of event classes. If no matching event class is found, this method may return
null.
Return type:XEventClass
get_classes()[source]

Returns the collection of event classes contained in this instance.

Returns:A collection of event classes.
Return type:dict_values
get_classifier()[source]

Returns the classifier used for determining event classes.

Returns:A classifier used in this set of classes.
Return type:dict
harmonize_indices()[source]

This method harmonizeds the indices of all contained event classes. Indices are re-assigned according to the natural order of class identities, i.e., the alphabetical order of class identity strings. This method should be called after the composition or derivation of event classes is complete, e.g., after scanning a log for generating the log info. Using parties should not have to worry about event class harmonization, and can thus safely ignore this method.

register(element)[source]

Registers a XES Element(log, trace and event and class ID) with this set of event classes. This will result in all events of this log being analyzed, and potentially new event classes being added to this set of event classes. Event classes will be incremented in size, as new members of these classes are found among the events in the log.

Parameters:element (XLog or XTrace or XEvent or str) – The Xes Element or Class ID to be analyzed.

opyenxes.classification.XEventLifeTransClassifier module

class opyenxes.classification.XEventLifeTransClassifier.XEventLifeTransClassifier[source]

Bases: opyenxes.classification.XEventAttributeClassifier.XEventAttributeClassifier

Implements an event classifier based on the lifecycle transition attribute of events.

opyenxes.classification.XEventNameClassifier module

class opyenxes.classification.XEventNameClassifier.XEventNameClassifier[source]

Bases: opyenxes.classification.XEventAttributeClassifier.XEventAttributeClassifier

Implements an event classifier based on the activity name of events.

opyenxes.classification.XEventResourceClassifier module

class opyenxes.classification.XEventResourceClassifier.XEventResourceClassifier[source]

Bases: opyenxes.classification.XEventAttributeClassifier.XEventAttributeClassifier

Implements an event classifier based on the resource name attribute of events.

Module contents