Loading Event Logs
ergminer.read_csv(filepath, case_id_col='case_id', activity_col='activity_name', timestamp_col='timestamp', resource_col=None, remove_incomplete_traces=True, min_events_per_trace=2)
Load an event log from a CSV file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str
|
Path to the CSV file. |
required |
case_id_col
|
str
|
Column name for case identifiers. |
'case_id'
|
activity_col
|
str
|
Column name for activity names. |
'activity_name'
|
timestamp_col
|
str
|
Column name for timestamps. |
'timestamp'
|
resource_col
|
Optional[str]
|
Column name for resource identifiers (optional). |
None
|
remove_incomplete_traces
|
bool
|
Drop incomplete/partial traces before returning. |
True
|
min_events_per_trace
|
int
|
Minimum events a trace must have to be kept. |
2
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
|
Source code in src\ergminer\read.py
ergminer.read_xes(filepath, case_id_col='case:concept:name', activity_col='concept:name', timestamp_col='time:timestamp', resource_col='org:resource', remove_incomplete_traces=True, min_events_per_trace=2)
Load an event log from an XES file (requires pm4py).
Default column names match the XES / pm4py standard, so no column arguments are usually needed beyond the file path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str
|
Path to the |
required |
case_id_col
|
str
|
Column name for case identifiers in the XES DataFrame. |
'case:concept:name'
|
activity_col
|
str
|
Column name for activity names. |
'concept:name'
|
timestamp_col
|
str
|
Column name for timestamps. |
'time:timestamp'
|
resource_col
|
Optional[str]
|
Column name for resource identifiers (optional). |
'org:resource'
|
remove_incomplete_traces
|
bool
|
Drop incomplete/partial traces before returning. |
True
|
min_events_per_trace
|
int
|
Minimum events a trace must have to be kept. |
2
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
|
Raises:
| Type | Description |
|---|---|
ImportError
|
If pm4py is not installed. |
Source code in src\ergminer\read.py
ergminer.read_dataframe(dataframe, case_id_col='case_id', activity_col='activity_name', timestamp_col='timestamp', resource_col=None, remove_incomplete_traces=True, min_events_per_trace=2)
Load an event log from an existing pd.DataFrame.
Applies the same timestamp parsing and optional trace filtering as
read_csv().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Source DataFrame. |
required |
case_id_col
|
str
|
Column name for case identifiers. |
'case_id'
|
activity_col
|
str
|
Column name for activity names. |
'activity_name'
|
timestamp_col
|
str
|
Column name for timestamps. |
'timestamp'
|
resource_col
|
Optional[str]
|
Column name for resource identifiers (optional). |
None
|
remove_incomplete_traces
|
bool
|
Drop incomplete/partial traces before returning. |
True
|
min_events_per_trace
|
int
|
Minimum events a trace must have to be kept. |
2
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Preprocessed |