-
Notifications
You must be signed in to change notification settings - Fork 1
Tutorial
Marc-Olivier Buob edited this page Jun 13, 2022
·
14 revisions
- Load the text file (
/var/log/Xorg.0.login this example):
FILENAME = "/var/log/Xorg.0.log" # Or any arbitrary log file
with open(FILENAME) as f:
XORG_LINES = [line.strip() for line in f.readlines()]- Compute the pattern-based clustering. Note you could tune parameters to customize the patterns considered by the pattern-based distance and the threshold used by the clustering algorithm. The
asyncspecifies whether the clustering must be parallelized or not.
from pattern_clustering import pattern_clustering
map_row_cluster = pattern_clustering(XORG_LINES, async=True)
pprint(map_row_cluster)