{ "cells": [ { "metadata": { "ExecuteTime": { "end_time": "2026-05-29T14:12:29.349613500Z", "start_time": "2026-05-29T14:12:29.332617Z" } }, "cell_type": "code", "source": [ "import warnings\n", "warnings.filterwarnings(\"ignore\", category=UserWarning)" ], "id": "1ccfbfcfbe89f820", "outputs": [], "execution_count": 1 }, { "cell_type": "markdown", "id": "5279e90c", "metadata": {}, "source": [ "# Log Filters\n", "\n", "The class `ProcessMiningTasks.LogFiltering.BasicFilters.BasicFilters` provides several functions to filter a log according to some input requirements. The `BasicFilters` class provides the following filtering functions:\n", "\n", "1. `filter_time_range_contained` that filters a log on a time interval.\n", "2. `filter_case_performance` that filters the log by a range of minimum performance and maximum performance, which is the duration of a case.\n", "3. `filter_start_activities` that filters all the activities that start with the specified set of start activities.\n", "4. `filter_end_activities` that filters all the activities that end with the specified set of end activities.\n", "5. `filter_variants_top_k` retains the top-k variants of the log.\n", "6. `filter_variants` filters a log by a specified set of variants.\n", "7. `filter_event_attribute_values` filters a log by the values of some event attribute. \n", "\n", "We first import such a class and the input `xes` log." ] }, { "cell_type": "code", "id": "d276cc2d", "metadata": { "ExecuteTime": { "end_time": "2026-05-29T14:12:32.160177900Z", "start_time": "2026-05-29T14:12:29.350613800Z" } }, "source": [ "import os\n", "\n", "from Declare4Py.ProcessMiningTasks.LogFiltering.BasicFilters import BasicFilters\n", "from Declare4Py.D4PyEventLog import D4PyEventLog\n", "\n", "log_path = os.path.join(\"../../../\", \"tests\", \"test_logs\",\"Sepsis Cases.xes.gz\")\n", "event_log = D4PyEventLog()\n", "event_log.parse_xes_log(log_path)" ], "outputs": [ { "data": { "text/plain": [ "parsing log, completed traces :: 0%| | 0/1050 [00:00