We use the optuna framework [1]} for sampling increasingly optimal sets of hyperparameters and use a configurable maximum duration as the stopping criterion.
Optimization of the agglomerative clustering step is performed similarly, with the difference of generating a test clustering in line 12 and using the LEA F1 metric instead of F1 for binary classification in line 13.
